iNTERFACEWARE Products Manual > Learning Center > Tutorials and Sample Scenarios > Routing and Processing Messages > Generating NACK Messages in Iguana 4.0 and Later > Creating the reject_message Python Module |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
Now that you have created the VMD file that generates the ACK and NACK messages, the next step is to create the Python script that determines whether to reject an incoming message. When a message is rejected, a NACK message will be returned to the application that sent the incoming message. For example, suppose that you want your channel to reject all incoming messages that have a value of A04 in the first field of the EVN segment (also known as EVN.1). The following Python function enables you to perform this task:
This function returns True if EVN.1 contains A04. It returns False if EVN.1 does not contain A04 or if no EVN segment exists in this message. For best results, the reject_message() function shown above is saved as a separate Python module. This enables you to reuse this script if you need to create a VMD file that filters the incoming messages so that messages that have been rejected are not processed. (See Creating the Filtering VMD File for an example.) To save this function as a Python module:
|