Using intermediate message events to receive messages

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.

Note: To build a sample inbound integration that includes an intermediate message event, see Building a sample inbound integration .

When including intermediate message events in a BPD, you should be aware of the following:

Procedure

  1. 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.

    Note: For a sample of an intermediate message event that is included in the process flow, connected with sequence lines, see Building a sample inbound integration.
  2. Click the Implementation option in the properties.
  3. Click the drop-down list and select Message from the Intermediate Event types.
  4. 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.
  5. 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.
  6. 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.

  7. 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.
  8. 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. Indicates this functionality was introduced in fixpack 8.0.1.2Periodically use the BPMDeleteDurableMessages command for deleting durable subscription events.

  9. Click the Data Mapping option in the properties.
  10. In the Output section:
    1. 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.
    2. 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 correlation icon 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).