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.
Before you begin
To perform this task, you must be in the IBM® Process
Designer desktop
editor.
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 Process Designer desktop editor.
- Open a process application that contains a BPD with a message
event.
- 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. The
variable is used as a correlation parameter, which allows you to correlate
an event recipient with a particular key.
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 allows you to test the implementation
in the Inspector.
In this example, you are creating
a UCA that uses the current process instance ID as the correlation
parameter. For example, if you have a process application with the
instance ID of 50 and another process application with the instance
ID of 100, if you invoke the UCA passing an ID of 50, only the first
process application receives the event.
- Save your work.