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.
- The customer user starts the process and enters the following order details: username, order id, paid amount.
- The 'accept payment details' task is sent to the manager user with the paid amount and username.
- The 'confirm order details' task is sent to manager user with the order ID and username.
- 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
Follow the steps in Deploying BPMN Samples to deploy the sample using the WSO2 BPS management console.
Login to the BPMN explorer using customer/customer credentials.
Select the PROCESSES tab to view the process in the process list.
Click Start and fill in the form that appears with the order details
Logout and Login as the manager using manager/manager credentials.
Select the MY TASKS tab. You will see two approval tasks for the order and payment details, as seen below.
Enter the relevant details in each of the tasks.
Login to the management console and navigate to Instances>BPMN.
Click on the Instance ID of the Parallel Order Process.
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.