web stats
setting the Status ... - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-14-2019, 07: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 ...

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
Reply With Quote
  #2  
Old 02-14-2019, 08:04 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

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;
}
__________________
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
Reply

Tags
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 03:20 PM.


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