Using the UCA to update the process state
With this design, the data is synchronized when passing through each
activity. However, in this tutorial, we want to demonstrate the
Message Event updating a process state.
Particularly, we will use the UCA to update the
response.decision value when the user
interacts in the Review Request Coach.
- Create a UCA to listen to the
response.decisionvalue. This task requires two steps: create a service (named Monitor Decision) and an UCA (also named Monitor Decision), as shown in Figure 30 and Figure 31.
Figure 30. Service diagram of Monitor Decision
Figure 31. Variable configuration of Monitor Decision service
- You need to add one more variable,
decision, in order to pass this value to the outside BPD to capture it. For the two previous services, you do not need to pass out any values because you just need one variable,
correlationId, to identify the process instance (see Figure 32).
Figure 32. Configuration of the new UCA, Monitor Decision
At this stage, you have enough information to re-design the Review Request Coach to monitor the
Figure 33. Review Request Coach’s diagram
- In Figure 33, you need to map the data for Monitor Decision as
decision = tw.local.response.decision correlationId = tw.local.request.requestID
A newly inserted coach,
Display confirmation, is just a simple coach to display the static information to the end user.
- Add the IME listener on the BPD in order to
listen to the incoming event of the decision value (Figure
Figure 34. Newly designed BPD
As you can see, the new IME is attached to Review Request activity. This new IME connects to the View Result activity, so that the Review Request activity does not connect directly to the View Result activity.
This new IME (named Monitor Decision Event Handler) will receive the event and update the
response.decisionvalue of the BPD, as shown in Figure 35.
Figure 35. Configuration of new IME, Monitor Decision Event Handler
Now you can run this BPD.