Announcement

Collapse
No announcement yet.

Set Destination Response in JavaScrip Transformer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:

  • #2
    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, 12:15 PM.

    Comment

    Working...
    X