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/.
Receive Task
A Receive Task is a simple task that waits for the arrival of a certain message, i.e., the process will stay in this wait state until a specific message is received by the engine, which triggers the continuation of the process. The sample related to this task is the BuyProduct.bar
found in the <BPS-HOME>/repository/samples/bpmnÂ
directory.
Flow of the sample
This sample executes as follows:
- The user (admin) fills the details of the product, including the product name and quantity.
- The receive task waits for a signal. Once a signal is received by the receive task, the process will continue to the next task.
- The user confirms/gets the product details.
Running the sample
- Follow the steps in Deploying BPMN Samples to deploy the sample using the WSO2 BPS management console.Â
- Log in to the BPMN Explorer using the admin/admin credentials.
- Access the PROCESSES tab to view the task in the task list.
- Click the Start button next to the receive task sample.
- Once the above step is done, a task appears in the MY TASKS tab.
- Fill the form associated with the task and click Complete.
After completing the first task, i.e., after filling the details of the product, send a message to the engine that triggers the process to continue after the receive task.Â
- Get the execution ID of the process instance using:
GET bpmn/runtime/executions (https://localhost:9443/bpmn/runtime/executions)
Identify the exucution ID of the execution with the task id "waitTask".
- After getting the execution ID, use this REST call to signal the specific execution:
PUT bpmn/runtime/executions/{executionId}Â
Request body (signal an execution):{ "action":"signal" }
- Then a message will be sent to the engine, and the receive task will be triggered which will allow the process to continue further.
- There will be a user task created after receiving the message.