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/.
Call Activity Sample
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 Call Activity Sample (
CreditApprovalProcess.bar
) can be found in the <BPS-HOME>/repository/samples/
bpmn directory. It consists of two BPMN processes:
- CallActivitiSample process
- loanCheck process
In this particular scenario, the CallActivitySample process invokes the independent LoanCheck process to verify the loan. All tasks in this scenario have been assigned to the admin (username:admin, password:admin) for the purpose of demonstrating the usage.
Flow of the sample
- The user is given a form to fill that includes his/her name and salary.
Using the call activity, the loanCheck process is invoked, which checks whether the user is eligible for a loan.
Condition: If the salary of the user > 100000, the loan is approved. Otherwise, the loan is rejected.
The user must verify the salary and the status of the loan.
Main process
The following diagram illustrates the flow of the main process as described above.
Process invoked by the call activity
The following diagram illustrates the process invoked by the Call Activity. This process (loanCheck) is an independent process that can be reused by any other process.
The XML code snippet for the call activity in the main process is as follows:
<callActivity id="callActivity" name="CallActivity" calledElement="loanCheck_1"> <extensionElements> <activiti:in source="salary" target="salary"></activiti:in> <activiti:out source="status" target="loanStatus"></activiti:out> </extensionElements> </callActivity>
Properties and Variables | Description |
---|---|
calledElement | This property references a process definition by its key. Here, it references the ID of the process that is to be invoked. Note: The process definition of the subprocess is resolved at runtime, i.e., the subprocess can be deployed independently from the calling process if required. |
salary
| When the subprocess starts, the value of the "salary" variable is passed/copied from the main process to the "salary" variable in the subprocess. |
loanStatus | When the subprocess has finished executing, the value of the “status ” variable in subprocess is passed/copied to the “loanStatus ” variable in the main process. |
Running the call activity 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.
- Select the PROCESSES tab to view the task in the task list.
- Click the Start button next to the CallActivitiSample.
- Select the MY TASKS tab. You will see that a task has appeared on the list. Complete this task to obtain credit information.
- Click the provided task and enter the required details (e.g., name and salary).
- Select the MY TASKS tab. You will see that another task has now appeared on the list. Complete this task to verify the loan.
- Once you have completed the task, another task will appear on the list. This task indicates whether the load was approved or rejected.