Announcement

Collapse
No announcement yet.

Post - Processor getError() from previous destinations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:00 AM.
Working...
X