See information about the latest product version
Using scratchpad areas in the local environment
The local environment tree includes a subtree called variables. This subtree is always created, but is never populated by the message flow. Use this area for your own purposes; for example, to pass information from one node to another. You can create other subtrees of the local environment tree.
The advantage of creating your own data in a scratchpad in the local environment is that this data can be propagated as part of the logical tree to subsequent nodes in the message flow. If you create a new output message in a Compute node, you can also include all or part of the local environment tree from the input message in the new output message.
To ensure that the information in the local environment is propagated further down the flow, the Compute mode property of the Compute node must be set to include the local environment as part of the output tree (for example, specify LocalEnvironment and Message). For further details about the Compute mode property, see Setting the mode.
However, any data updates or additions that you make in one node are not retained if the message moves backwards through the message flow (for example, if an exception is thrown). If you create your own data, and want that data to be preserved throughout the message flow, you must use the environment tree.
You can set values in the variables subtree in a Compute node and those values can be used later by another node (Compute, Database, or Filter) for some purpose that you determine when you configure the message flow.
SET OutputLocalEnvironment.Variables.OutputLocation = 'MQ';
IF InputLocalEnvironment.Variables.OutputLocation = 'MQ' THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData.queueManagerName = 'myQManagerName';
SET OutputLocalEnvironment.Destination.MQ.DestinationData.queueName = 'myQueueName';
END IF;
In the example, queueManagerName and queueName are set for the Destination subtree in the output message. You must set the Compute mode of the second Compute node to include the local environment tree in the output message. Configure the MQOutput node to use the destination list that you have created in the local environment tree by setting the Destination Mode property to Destination List.
For information about the full list of elements in the DestinationData subtree, see Data types for elements in the MQ DestinationData subtree.