web stats
Set Destination Response in JavaScrip Transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 06-26-2019, 04:32 AM
hhergdgdfg hhergdgdfg is offline
What's HL7?
Join Date: May 2019
Posts: 4
hhergdgdfg is on a distinguished road
Default Set Destination Response in JavaScrip Transformer

Hi I have:

1. Connector "Destination1" with Connector Type "File Writer":

2. I have one JavaScript Transformer in "Destination1" that is doing an xml validation.

I want that to set the response for the Destination1 Connector in the JavaScript transformer:
Reply With Quote
Old 06-26-2019, 12:04 PM
agermano agermano is offline
Mirth Guru
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,176
agermano is on a distinguished road

I don't think you can do exactly what you are asking for, but there are multiple options depending on what your goal is.

The destination response is initially set by the destination connector after it tries to send the message (this would be your File Writer.)

You can override the destination response in the destination's Response Transformer. In order to get the response transformer to fire for a File Writer, you need to set its inbound (required) and outbound (optional) data types to Raw.

If you don't need to actually override the destination's response, but you just want to send your message back to the upstream connection, in your transformer you can put your validation result in the responseMap, and then select that responseMap variable as your response on the source tab of your channel.

Edit: The user guide should be helpful if you need additional info about Response Transformers or using the responseMap.

Last edited by agermano; 06-26-2019 at 12:15 PM.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 08:07 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation