web stats
Mirth Community - View Single Post - Post - Processor getError() from previous destinations
View Single Post
  #1  
Old 01-15-2019, 06:23 AM
Mirthvu14 Mirthvu14 is offline
OBX.1 Kenobi
 
Join Date: Jan 2019
Posts: 30
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