Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   setting the Status ... (http://www.mirthcorp.com/community/forums/showthread.php?t=218946)

sid1 02-14-2019 08:21 AM

setting the Status ...
 
version: 3.5.0.8232

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

narupley 02-14-2019 09:04 AM

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:

Code:

if (<whatever condition you want>) {
    responseStatus = ERROR;
}



All times are GMT -8. The time now is 10:27 AM.

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