Search code examples
ibm-integration-busextended-sql

How to create a variable in IIB which has scope for each single flow?


I need to create a variable in IIB flow which has to be available through out the flow. I have gone through the variables creation in documentation. As per my understanding, I should create a SHARED variable in ESQL module. But in documentation its mentioned as "Subsequent messages can access the data left by a previous message." which I didn't understand.

Could anyone please suggest how to create a variable which should have scope only for that flow(only per each request/instance)?

For example if I have to capture total value of some elements in payload and store calculated value in the created variable which I can use across all the nodes throughout the flow .


Solution

  • The Environment tree structure can be used for your use case:

    The environment tree differs from the local environment tree in that a single instance of it is maintained throughout the message flow.

    When the message flow processing is complete, the Environment tree is discarded.