Attach the undercover agent (UCA) to the message event.
The event waits for the completion of the UCA. When the UCA completes,
the event completes.
About this task
After you create the UCA, you should go back to
the message event in the BPD and attach the UCA as described in the
following steps.
Procedure
- Open the BPD that includes the message event.
- Click the message event in the BPD to select it.
- Click the Implementation option in the properties.
- In the Message Trigger section, click the Select button
next to the Attached UCA field and pick My UCA that
you created in the preceding steps.
- Ensure that the Consume Message and Durable
Subscription check boxes are enabled. (For more information
about these options, see Modeling message events.)
Tip: If you occasionally use inbound messages, consider
using durable subscription events. Durable subscriptions are Java
Message Service (JMS) subscriptions that persist and store subscribed
messages even when the client is not connected. 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. Notice that the Output correlation key is automatically
set to the someString variable from the UCA.
Note: When
an event occurs, that event must be matched against the correct instance
of the process for which the event is destined. The ability to match
the event against the correct instance is called correlation. You
must specify one variable in the message event that has a value that
matches the value of the incoming event's UCA payload (the correlation
value). If there is such a match, the message is received. If not,
the message is not received, and the event continues to wait.
- In the field next to the variable, type tw.system.process.instanceId.
This sets the value of the someString variable to
the ID of the running instance, which enables you to test the implementation
in the Inspector.
- Save your work.