web stats
Post - Processor getError() from previous destinations - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2019, 06:23 AM
Mirthvu14 Mirthvu14 is offline
OBX.1 Kenobi
 
Join Date: Jan 2019
Posts: 26
Mirthvu14 is on a distinguished road
Default Post - Processor getError() from previous destinations

Hi,
in postprocessor I create a ack.

Code:
err=$(previousDestination).getError();

var serializer = SerializerFactory.getSerializer('HL7V2');
var ack =  XML(serializer.toXML( ACKGenerator.generateAckResponse(message.getConnectorMessages().get(0).getRawData(),'AA','')));

if (err != null)
{
	ack.MSA['MSA.1']['MSA.1.1']='AA';
	ack.MSA['MSA.3']['MSA.3.1']='';
	
}
else
{
          ack.MSA['MSA.1']['MSA.1.1']='AE';
	  ack.MSA['MSA.3']['MSA.3.1']=err;
}
In my channel I have different destinations, which use filter, transformer and response scripts.

I saw that if a destination errors out in the filter/transformer script, subsequent destinations in the same chain will not be executed, and the getError() for transformer script is empty. When the error is in response script getError(), show me the correct value.

I also try to use:
Code:
 err=$(previousDestination);
But, in this case, err is always: 'ERROR: Error converting message or evaluating filter/transformer'. I want the Reference Error, with more detail.

How can I do to populate the 'err' variable for the ack.MSA['MSA.3']['MSA.3.1'], when I have an error in a transformer script?

Thanks a lot

Last edited by Mirthvu14; 01-16-2019 at 04:00 AM.
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 02:34 PM.


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