You can include an intermediate message event in your BPD
when you want to model a message event received during execution of
a process.
About this task
Intermediate message events can be attached to
activities within your BPDs or they can be included in the process
flow, connected with sequence flows.
When including intermediate
message events in a BPD, you should be aware of the following:
- The general information that applies to all types of message events
covered in Modeling message events.
- You can enable durable subscriptions for intermediate message
events. When a message arrives before a process has run to a point
where the event can accept the message, the durable subscription causes
the message to be stored until the message event is reached. Only
the most recently received message is stored.
- When the process execution reaches an intermediate message event,
further execution along that path is blocked until an incoming message
arrives.
- When you use an attached or intermediate message event to receive
messages, you must select an undercover agent output variable to assign
a correlation value that will ensure that the parameter values of
the runtime message are passed to the correct BPD instance. You must
also map the undercover agent output variables to local variables
in the BPD.
- Drag an Intermediate Event component from the palette
onto the BPD diagram so that it is attached to an activity.
The
event is anchored to the activity. To verify this, select the activity.
If the activity's outline includes the event, the event is attached.
- Click the Implementation option in the properties.
- Click the drop-down list and select Message from
the Intermediate Event types.
- In the Boundary Event Details section,
the Interrupt Activity? check box is selected
by default. This setting closes the attached activity when the message
event is triggered. You want this behavior in cases where the receipt
of the message event signals completion of the activity. Otherwise,
clear this check box.
- In the Message Trigger section, click Select next
to the Attached UCA field to select a preexisting
undercover agent.
To create an undercover agent, click New.
See Understanding and using undercover agents.
UCAs
must have a schedule type of On Event to function
as a message trigger. Plus, the service attached to the selected undercover
agent must have one or more input variables so that it can pass and
correlate information from the event.
Note: Ensure that the sender
and receiver of the message both use the same undercover agent. For
example, if the sender of the message is a message end event in another
BPD, then select the same undercover agent for both the receiving
intermediate event and the sending message end event in the other
BPD.
- In the Condition text box, type a JavaScript expression
if you want to define conditions under which the message event is
processed.
If you do specify a condition and the condition
evaluates to true, the message is accepted and processing continues.
If the condition evaluates to false, processing stops. In most cases,
special message conditions are not necessary because you should implement
each message event with a separate undercover agent.
- Enable the Consume Message check
box if you want the incoming message to be consumed after it has been
received by the message event. Refer to the bulleted list in Modeling message events to learn more about message consumption.
- Select the Durable Subscription check
box to allow the message event to receive an incoming message, even
when the message event is not in an active state. (When a token is
on a step, that step is in an active state. See Understanding tokens for
more information.)
Tip: If you occasionally
use inbound messages and undercover agents, consider using durable
subscription events.
When Durable Subscription is
selected, incoming messages are persisted in the database. The durable
messages accumulate, even if you select the check box to make them
consumable. Periodically use the BPMDeleteDurableMessages
command for deleting durable subscription events.
- Click the Data Mapping option in the properties.
- In the Output section:
- Click the variable selector icon on the right side of
each field to map each undercover agent output variable to a local
variable in the BPD.
- Select the variable that you want to use to correlate
the event with the BPD instance. The variable selected for correlation
is identified by an assignment symbol. This correlation ensures that the parameter
values of the runtime message are passed to the correct BPD instance.
(IBM® Business Process Manager only
requires one variable mapping to correlate the event).