The .bar file relevant for this sample is XMLVariableTypeUsageProcess.bar.
Flow of the sample
This sample is based on a bookstore to handle pending arrivals of books.
- Get the list of pending arrivals..
If there are no pending arrivals, a message stating "No Pending Arrivals" is printed.
If there are pending arrivals, a user task is triggered and assigned to the admin to add a new book.Info The following code snippet shows the above condition using the XML variable.
Code Block language js {xmlDoc.xPath("/bookstore/pendingArrivals/text()") > 0}
- The new book is added to the book list.
- The last service task prints the book list.
Deploying and running the sample
- Login to the management console as the admin, using admin/admin credentials.
- Navigate to Processes > Add > BPMN and upload the
XMLVariableTypeUsageProcess.bar
file found in the<BPS_HOME>/repository/samples/bpmn/
directory. Login as admin on the BPMN explorer using admin/admin credentials.
- Select the Processes tab and start a two process instance of the XMLVariableType process; one with the Pending Arrivals Count field set to 0 and another one with the Pending Arrivals Count set to 1.
- Select Tasks>My Tasks tab and you will see that the process instance you started with a pending arrivals count of 1 will appear on the task list as a user task.