This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Parallel Branching

Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation:

  • <PRODUCT_HOME>/repository/samples/ directory that includes all Business Process profile samples and their artifacts is changed to <EI_HOME>/samples/business-process/.

The .bar file relevant for this sample is OrderApprovalProcess.bar found in the <BPS-HOME>/repository/samples/bpmn directory.

Flow of the sample

In this sample, an inclusive gateway is used to perform parallel branching.

  1. The customer user starts the process and enters the following order details: username, order id, paid amount.
  2. The 'accept payment details' task is sent to the manager user with the paid amount and username.
  3. The 'confirm order details' task is sent to manager user with the order ID and username.
  4. Once the above tasks are completed, the order is approved and sent for delivery. A task will be sent to the customer user to notify the order availability.

The declaration of the parallel gateways is as follows. 

<parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
<parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>

The flow execution of the paths is declared as shown below. usertask1 refers to accept payment details, whereas usertask2 refers to confirm order details. 

<sequenceFlow id="flow2" sourceRef="parallelgateway1" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="parallelgateway1" targetRef="usertask2"></sequenceFlow>
 
<sequenceFlow id="flow4" sourceRef="usertask2" targetRef="parallelgateway2"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="usertask1" targetRef="parallelgateway2"></sequenceFlow>

Running the sample

  1. Follow the steps in Deploying BPMN Samples to deploy the sample using the WSO2 BPS management console. 

  2. Login to the BPMN explorer using customer/customer credentials.

  3. Select the PROCESSES tab to view the process in the process list. 

  4. Click Start and fill in the form that appears with the order details

  5. Logout and Login as the manager using manager/manager credentials.

  6. Select the MY TASKS tab. You will see two approval tasks for the order and payment details, as seen below.

  7. Enter the relevant details in each of the tasks.

  8. Login to the management console and navigate to Instances>BPMN.

  9. Click on the Instance ID of the Parallel Order Process.

  10. You will now be able to view a more detailed BPMN process instance with its process state diagram which will display the current active position of the instance in red.Â