Sharing data between a calling flow and a response flow
You can share data between a flow that contains a CallableFlowAsyncInvoke node (the calling flow) and a flow that contains a CallableFlowAsyncResponse node (the response flow), by storing and retrieving data in the UserContext folder in the Environment.
Before you begin
- Read the concept information in Callable message flows.
- Create a calling flow, a callable flow, and a response flow, as described in Developing asynchronously callable message flows.
About this task
The user context is a storage area that is used to pass data that is not part of the message between nodes in a message flow. For example, by using the user context, you can pass state from the CallableFlowAsyncInvoke node in the calling message flow to the CallableFlowAsyncResponse node in the response message flow. However, this user context data is not accessible to the called message flow.
SET Environment.CallableFlow.UserContext = 'myData';
UserContext
element
in the message tree:<environment>
<CallableFlow>
<CorrelationID>43414c4c0100000000000000f3264f744805000000000000</CorrelationID>
<UserContext>myData</UserContext>
<environment>
<CallableFlow>
<CorrelationID>43414c4c0100000001000000603a52741828000000000000</CorrelationID>
<UserContext>
<c1>
<c2>myData</c2>
When the user context data has been specified, the CallableFlowAsyncResponse node can subsequently retrieve it.
mixed
child element Environment.CallableFlow.UserContext.mixed
,
as shown in the following diagram: xsd:any
and
map to them, as shown in the following diagram:To access the user context data after a CallableFlowAsyncResponse node, read the value or children of the Environment.CallableFlow.UserContext environment variable.