Build it yourself

This section describes the steps to do to complete the sample. We have provided a business process design fragment which is available for you to download.

Please go to the download tab and download the \*.twx file named: BPMN20_EventGateway_START.twx

Then import this file into IBM Process Designer v751. Once imported, open the Process Application in IBM Process Designer, as shown here in the following illustration:

importandopenPA 

Before you enhance the given business process design, first have a look at the Process Applications in more detail.

First open the two process diagrams to see, that there is no event gateway and no message events, compared to the process diagrams you have seen here in the overview section. Actually in this section you will create those missing pieces with their underlying attribute settings. You may investigate the tasks and their coaches, but you do not have to perform anything for those tasks.

openprocess 

Now have a look at the variables of the EditAndFile Order process:

For this exercise dealing with the event gateway and message send / receive events, the most important data element is the CorrelationOrderID, because this data element will allow the BPMN engine to correlate the messages between the two processes.

Next, have a look at the implementations available in your imported Process Application:

implementationsection 

Most important are the two UnderCover Agents (UCAs), which will transport the message data from one process to the other. Open the UCA named UCA_CancelOrder, and from there its implementation service:

ucaserviceimpl 

In the service, open its diagram tab to see that the service is empty, with the exception that its start and end node are connected. In addition, there is only one string defined as input and output data element. This string is filled with the CorrelationOrderID when performing the required data mapping when creating the message send and recieve events. You will see how this is done here in the sample.

NOW - it's time for you to get started.

Open the process 'EditAndFileOrder' (if not alread opened), and switch to the diagram view. Scroll to the empty area between the two tasks 'Validate Order' and 'Cancel Order'. From the palette, drag and drop a gateway on the process diagram.

addgateway 

Add some text like 'How to proceed?' or similar, then look at the properties section and select the gateway type to be 'Event gateway':

selecteventgateway 

With that, the event gateway is specified, and you can see in the process diagram that a timer event and a message event was added, and all these three elements are in a grey rectangle, to visualize that these modeling objects belong together.

Next, you need to add an additional message receive event, and then the events need to be further specified. Before you do this, enlarge the grey rectangle by simply selecting it, then enlarge the area. Now grab the event from the palette, and drag it into the grey area, to add it to the event gateway:

addmessageevent 


IBM Process Designer automatically connects the new event to the event gateway. Now, when the process is executed, the event gateway will investigate three different events, which however will have to be further specified.

Select the newly added message event, and look at its properties.

This defines the first message event of the gateway.

Now repeat these steps for the message event that was created when the event gateway was created, but this time name the message event 'Cancel Order', select the message type 'Message Intermediate Event', assign the UCA named 'UCACancelOrder', and assign the variable used for the correlation, which is the same as used by the other message event (select 'CorrelationOrderID' from the presented list).

Finally, specify the wait time of the timer connected to the event gateway:

Now connect the message events and the timer with the tasks available in the process. Create the following links:

The process does now look like the process shown in the Overview section.

This completes what needs to be done in the EditAndFileOrder process.

Save your work, and open the 'ModifyOrder' process.

In the 'ModifyOrder' process you will have to add to message intermediate events, which are sending messages. First, from the palette, drag an event and drop it into the process diagram, as shown here:

addmessagereceiveevent

Now, change the properties of the message event:

Repeat these steps to create a second message event, this time handling the order modification.

When done, connect the message events with the preceeding gateway, and with the end node.

The last step is to specify the decision conditions at the CancelOrder? gateway. Select the gateay, select the implementation tab, and define the following:

specifycancelordergateway

Save your work, you are done with the 'ModifyOrder' process. Now you can run the process to see if and how it works.

This is it! Move on to the run the sample section.