Store a property in the message context so that it is available
for use later in the mediation flow. First, add the property as an empty business
object in the message context. Then, initialize the property by using a mediation
primitive such as Message Element Setter to add a value to the business object
attribute.
You can use the context section of the message to store a property
that mediation primitives can use later in the flow. The data to be contained
in the context must be defined in a single business object. There are two
context elements that can be used for passing properties in a flow:
- correlation
- makes the property persist throughout the duration of the request and
response flows, and is used for passing values from the request flow to the
response flow.
- transient
- makes the property available for the duration of the current flow (either
the request flow or the response flow), and is used to pass values between
mediation primitives in the same flow.
In the Mediation Flow editor, both correlation and transient
contexts are defined in the input node in the request flow, even though the
value may not be set until the response flow. The value of a correlation context
property persists through the request and response flows. The value of a transient
property is only available to mediation primitives in the flow in which it
was set.
Follow these steps to set a property in the correlation or transient
context of your flow:
- If you do not have an existing business object, create one in the
business object editor, and add the persistent property as an attribute.
- Click on the request flow tab, and then click on the input node.
- In the Properties view, switch to the Details tab.
- In the Correlation context or Transient context field, click Browse.
- Select a business object in the data type selection window, and
click OK. An empty business object
is created in the message's context section. In the properties view, the business
object now appears in the input node's context field, as shown below:

- Initialize the property later in the flow by using a mediation
primitive such as Message Element Setter to store a value in the business
object attribute.
You can use an XPath 1.0 expression to access the property from any
mediation primitive in the flow, except Fail and Stop. For example, to access
the transient property
oneWayStreet, use this XPath expression:
/context/transient/oneWayStreet
You can then
use the property in the following ways:
- Set a value for the property directly into the business object attribute
by using a Message Element Setter or Database Lookup primitive.
- Use the property in an Endpoint Lookup primitive to query the WebSphere® Service
Registry Repository.
- Map the property between the context and the message body by using an
XSL Transformation primitive.
- Write your own custom mediation primitive to set or get the property.