Context tree
The context tree is part of the set of logical trees (message assembly) in which information about the message flow is captured, including information about how the flow was invoked and the messages from each node in the flow. Unlike the other logical trees, the context tree is not captured by default. In order for it to be made available, it must be referenced in the message flow.
When a flow starts, the integration server detects whether a context tree is referenced. If a context tree is referenced in the flow, it can be accessed from all nodes in the flow that support context trees, such as JavaCompute nodes and ESQL nodes, including Compute, Filter, Database, and DatabaseInput nodes.
- An introduction to context trees
- Using ESQL to reference locations in a context tree
- Using ESQL to reference locations in a context tree from nested subflows
- Accessing a context tree by using the JavaCompute node
- Using the JavaCompute node to access the context tree from a subflow
- Using the JavaCompute node to reference locations in a context tree from nested subflows
- Flow details
- The flow details include the following information about the message flow:
- Flow name
- Application name
- Library name
- Integration server name
- Integration node name
- Hostname (fully-qualified hostname)
- Process ID
This information does not change between message invocations.
- Invocation details
- The invocation details contain information about the current message invocation:
- Timestamp
- Thread ID
- Node name (the name of the input or response node that received the invocation)
- Nodes
- This section contains information about each node that has been propagated through the flow at
the point where the tree is viewed:
- Node name
- Payload details
- Domain
- Encoding
- CodedCharSetId
- Message
- Model
- Physical format
- Payload
- Headers
- Email
- Email header folders copied as-is from the main message tree (such as EmailInputHeader and EmailOutputHeader)
- HTTP
- HTTP header folders copied as-is from the main message tree (such as HTTPInputHeader and HTTPRequestHeader)
- JMS
- JMS header folders copied as-is from the main message tree (such as JMS_Transport)
- MQ
- MQ header folders copied as-is from the main message tree (such as MQMD, MQRFH2, and MQCIH)
- Email
- Metadata
- QueueManager
- MQ nodes only
- Queue
- MQ nodes only
- URL
- HTTPAsyncRequest, HTTPRequest, RESTAsyncRequest, RESTRequest, SOAPAsyncRequest, and SOAPRequest nodes only
- Method
- RESTRequest node only
- StatusCode
- HTTPRequest and RESTRequest nodes only
- Parameters
- REST applications only
- Variables
- Callable flows only
- QueueManager
- Node type
- Payload details
- Node name
The input node of the message flow populates the FlowDetails section of the context tree with key information about the flow; this information does not change throughout the flow and it does not change when propagating in and out of subflows. The input node also populates the InvocationDetails section of the context tree with information about the message being processed.
As a flow propagates forward through the message flow nodes, a node section is captured in the context tree on the exit of each node. When the flow processing unwinds to a point before a flow node, the node section is removed from the context tree. At any point in a flow, a JavaCompute node or an ESQL node (such as a Compute, Filter, Database, or DatabaseInput node) can access the message that was output from any node up to that point. Even if you set a breakpoint before a JavaCompute or ESQL node, the context is visible in the breakpoint before that node. This means that you do not need to write code to store part of a message tree in the Environment, LocalEnvironment, or SHARED ROW variable for future use in the flow. As context trees hold the node section that is captured for all the nodes in a flow, they use more memory than a targeted capture of data into the Environment tree. However, although they are slower and require more memory than using Environment or ESQL shared variables, context trees are easier to use and are less time-consuming than writing code to store parts of the message tree.
Nodes that are used in routing (such as Label, RouteToLabel, and FlowOrder nodes), error handling (such as Trace, TryCatch, Throw, and Log nodes), or checking (such as Validate and SecurityPEP nodes) do not capture a node section to the context tree.
When a subflow node propagates into its subflow, a context tree section is captured from the input terminal to represent the data that was sent into a subflow. This means that only the data that is sent into the subflow is visible to the subflow by default. Whilst in a subflow, the nodes in the subflow capture their content to the context tree, and they are visible to the nodes in the subflow. When the flow propagates out of a subflow (by using a subflow output terminal node), a single representation of the whole subflow node is added to the context tree of the calling flow or subflow. This means that only the data that is exiting the subflow is visible in relation to the subflow node.
The message body in the main message tree is represented as the payload element in the context tree. The associated PayloadDetails.Domain field indicates what the message domain is. The rest of the PayloadDetails fields show what other data is associated with the payload. To represent the payload in the context tree, basic information needs to be read from the message body in the message tree. This does not initiate a parse of the message or validate the message when validation is enabled. However, if there is an issue in setting up the parser (such as a JSON parser being unable to find its named JSON schema), this is reported immediately when context trees are enabled.
- Any HTTP-related headers are added to an HTTP subfolder
- Any MQ-related headers are added to an MQ subfolder
- Any JMS-related headers are added to a JMS subfolder
- Any Email-related headers are added to an Email subfolder
The Metadata folder is populated with key information about external interactions with MQ, HTTP, SOAP, REST, and Callable flows. This information is populated from parts of the information that is already being stored in the LocalEnvironment for these transports.
- FlowDetails
- FlowName
- ApplicationName
- LibraryName
- IntegrationServerName
- IntegrationNodeName
- HostName
- ProcessId
- InvocationDetails
- Timestamp
- ThreadId
- NodeName
- Nodes
- "users nodeLabel1"
- PayloadDetails
- Domain
- Encoding
- CodedCharSetId
- Message
- Model
- PhysicalFormat
- Payload
- Headers
- HTTP
- …. Folders copied as-is from the main message tree (Such as HTTPInputHeader, HTTPRequestHeader)
- MQ
- …. Folders copied as-is from the main message tree (Such as MQMD, MQRFH2, MQCIH ….)
- ....
- Metadata
- NodeType
- ….
- "users nodeLabel2"
- PayloadDetails
- ….
- Payload
- …. Folders copied from the main message tree.
- Headers
- …. Folders copied from the main message tree.
- Metadata
- NodeType
- ….
- ….