No announcement yet.

setting the Status ...

  • Filter
  • Time
  • Show
Clear All
new posts

  • setting the Status ...


    Trying to figure out how to set the status of a msg after a reply or error has occurred.

    The following code will appear to work from the post-processor, but when I go back to the Dashboard, the msg status shows as 'Queued''Status 01: ' + $r('Destination 1').getStatus());
    -> Displays: 'Status 01: QUEUED

    responseMap.put('Destination 1', ResponseFactory.getErrorResponse('message'));'Status 02: ' + $r('Destination 1').getStatus());
    -> Displays: 'Status 02: ERROR

    How do I set the status so that is shows as 'ERROR' in dashboard as well and does not make anymore attempts to transmit ?

    Thank you

  • #2
    Do that in the response transformer of your destination. On the Destinations tab, click on "Edit Response".

    By default the response transformer only executes if you actually have a response payload to transform. If the error is something like a connection or read timeout then there won't be a response payload. If you want the response transformer to execute all the time even in these cases, you can set the Response data types to Raw.

    There are helper templates in the References tab, under the Response Transformer category. There's also a section on this in the User Guide. To force a message to ERROR status, simply set the responseStatus variable:

    if (<whatever condition you want>) {
        responseStatus = ERROR;
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

    - How do I foo?
    - You just bar.