web stats
Response from Postprocessor does not set ERROR - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2015, 07:08 AM
hugosoares2 hugosoares2 is offline
OBX.2 Kenobi
 
Join Date: May 2011
Posts: 64
hugosoares2 is on a distinguished road
Default Response from Postprocessor does not set ERROR

Hi,
has anyone ever noticed that responding from the postprocessor like so:

Code:
return ResponseFactory.getErrorResponse(outcomeJSON);

does not actually set the message to ERROR status? Is this a bug?
In my case it remains in the TRANSFORMED state.


Using Mirth 3.2.1
Reply With Quote
  #2  
Old 08-25-2015, 07:13 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

It's not supposed to overwrite the source connector's status. If you choose Response: Postprocessor and then return that from the postprocessor script, that response is what's sent to the originating system. If that was a Channel Writer or VMRouter call, then the caller will have access to that entire Response object. Otherwise it's up to the source connector to decide if anything should be done based on the status. For example on the HTTP Listener, unless you set a specific response status the receiver will send back a 500 code if the response you choose has a status of 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
  #3  
Old 08-25-2015, 07:30 AM
hugosoares2 hugosoares2 is offline
OBX.2 Kenobi
 
Join Date: May 2011
Posts: 64
hugosoares2 is on a distinguished road
Default

I understand.

In my case I have an http listener that gets the http response code from a channelMap variable and uses the postprocessor response message has the reponse body.

I feel that in case I need to respond with an http 422 client error the source connector should mark the message has error to be consistent with the actual flow status.

I guess if Mirth had a response transformer on the soruce connector it could be done?
Reply With Quote
  #4  
Old 08-25-2015, 08:08 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

It can still be done. The response status code field is replaceable, so you can set a channel map variable in the postprocessor (like "responseStatusCode"), and use it in the HTTP Listener settings (like ${responseStatusCode}).
__________________
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
  #5  
Old 08-25-2015, 08:30 AM
hugosoares2 hugosoares2 is offline
OBX.2 Kenobi
 
Join Date: May 2011
Posts: 64
hugosoares2 is on a distinguished road
Default

I guess I did not explain well.
Even if I respond with status 422 the source connector message status still shows up as TRANSFORMED and not ERROR.
Reply With Quote
  #6  
Old 04-20-2016, 08:05 AM
mynw2003@yahoo.com mynw2003@yahoo.com is offline
What's HL7?
 
Join Date: May 2012
Posts: 1
mynw2003@yahoo.com is on a distinguished road
Default

Did you get an answer to this? I have the same issue.
Reply With Quote
Reply

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 01:07 AM.


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