My last article on gateways is on the event-based gateway, another type of gateway supported by Oracle BPM 12c to provide divergence in processes.
The event-based gateway is very similar, conceptual wise, to the exclusive gateway in the sense that we can have various outgoing sequence flows but only one branch is followed. The operational difference though is that, as its name suggests, the event-based gateway uses events for defining the branching conditions and decisions rather than data-specific conditions.
Using the order process as an example, once an order is received and validated it needs to be processed. Assuming that we have multiple warehouses, the order will be processed by the warehouse that can process all inventory items ordered and responds first. The process will wait until one of the warehouses responds to the request for processing the order. However, the process cannot wait indefinitely.
So let's see how we can implement the above scenario using the event-based gateway.
Let's start with creating the basic BPM application and BPM project (named both application and project "EventBasedGatewayDemo") and selecting "Composite with BPMN Process" in step 3.
Select and drop the "Event Based" gateway on the default sequence flow between the "Start" and "End" activities. You should notice that JDeveloper automatically has added three activities; an event based split gateway activity, a catch message activity and a timer catch activity.
I will use the order id to correlate the events that will be flowing from the warehouses into the main order process, therefore I have created a correlation property named "orderId" and of type int and a correlation key named "ck_orderId" with the orderId correlation property selected.