|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
Suppose that you have defined an Iguana channel through which the following messages are transmitted:
Also suppose that you have created a VMD file containing two message definitions, ADT and ORM, corresponding to the above message types. You can modify this VMD file to add Python scripts that detect whether messages of either type have stopped flowing. To do this, you need to:
Because all of the work of checking whether messages have stopped flowing is done in the external Python module, the scripts that you need to create for the VMD file are very simple. The Global Inbound Script, which initializes the message checking process, looks like this:
Some notes on how this script works:
Now that you have created the Global Inbound Script, the next step is to define Transformation Scripts for each of your message types. A Transformation Script for a message definition is invoked whenever a message of that type is processed.
For the ADT message definition, the Transformation Script looks like this:
For the ORM message definition, the Transformation Script is very similar:
In both cases, the script calls touchMessage() to indicate that a message of this type has been received, providing the name of the message definition as a parameter. The script then calls checkForInactivity() to determine whether messages of other types have been received recently.
After you have created the scripts, the final step is to modify the VMD file to indicate that it is performing scripted transformation. To do this:
Your VMD file is now ready for use. Now that you have defined the VMD file that detects whether messages of a given type are appearing, the next step is to update your Iguana channel to use this VMD file.
|