web stats
setting the Status ... - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 02-14-2019, 08:21 AM
sid1 sid1 is offline
OBX.1 Kenobi
Join Date: Jun 2017
Posts: 38
sid1 is on a distinguished road
Cool 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'
logger.info('Status 01: ' + $r('Destination 1').getStatus());
-> Displays: 'Status 01: QUEUED

responseMap.put('Destination 1', ResponseFactory.getErrorResponse('message'));

logger.info('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
Reply With Quote
Old 02-14-2019, 09:04 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road

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.
Reply With Quote

postprocessor, status code

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:09 AM.

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