4. Synchronizing Credit Check Approval with customer
We want to model the fact that when a message Payment OK is received by the Credit Check Approved event, the event matches this with the ID of the person requesting the reservation. We want to match on an attribute called ID.
We also want to branch the Sequence Flow at the beginning of our Process Flow, so that the Reservation object (or token) flows to both the Check Customer Credit process and the Credit Check Approval event.
1 Add a gateway to the Reception lane, as shown in the picture below – just before the Check Customer Credit process, and name it AND Gate (or anything else that comes to mind – this gateway is simply to add logic to our diagram; it does not need to correlate with anything in the check credit process). Break the connection existing between the event Customer Agrees to Reserve Room and Check Customer Credit, and instead draw Sequence Flow lines as shown in the diagram below.
2 Open the Definition dialog of the new AND Gate, set its Stereotype to AND, and then click Apply.
3 Within the Credit Check Approval event, go to its Message tab, and within the Match Joined Objects group, specify to match By ID.
4 Reopen the definition of the Credit Approved event, go to its Message tab, and within the Match Received Objects group, specify to match By ID.