Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Set Destination Response in JavaScrip Transformer (http://www.mirthcorp.com/community/forums/showthread.php?t=219225)

hhergdgdfg 06-26-2019 05:32 AM

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:https://www.imbie.uni-bonn.de/wp-con...nshot.2335.jpg

agermano 06-26-2019 01:04 PM

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.


All times are GMT -8. The time now is 05:42 AM.

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