iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Chameleon Python API > Iguana Channel Functions > Enqueueing the Original Message When Performing ACK Verification |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
If you have created a channel whose destination component is LLP Client, you can use the enqueue_message() function to route incoming messages to one or more additional channels.
To do this, in the LLP Client component, you will need to set the ACK verification list box to Verified ACK message, then create a custom VMD file to handle acknowledgments and redirect the incoming messages: When the ACK verification list box is set to Verified ACK Message, the custom VMD file that handles the ACK verification will process both the ACK message and the original message. (The ACK message is processed first.) Because the custom VMD file processes the original message, you can use enqueue_message() to redirect this original message to another channel. For example, suppose that you have a custom VMD file that contains the following:
In this VMD file, you can create simple Python scripts that redirect the incoming ADT^A04 messages to one channel and redirect the incoming ORU^R01 messages to another channel. The first script is a Global Inbound Script that assigns the incoming message to a global variable:
The next step is to define the following Segment Inbound Script for the Message Control ID field (field 10) of the MSH segment:
In this script, the input_identity() function returns the name of the message definition that has matched the incoming message. Because messages of type ADT^A04 are matched by the message definition whose name is ADT, the call to enqueue_message() adds these messages to the message queue for the channel named acktest1. Similarly, messages of type ORU^R01 are matched by the message definition named ORU, and are added to the message queue for the channel named acktest2. Acknowledgment messages are handled by the message definition named ACK, and are not redirected anywhere (though they could be). |