The following tutorial guides you through creating a human task artifact using the human task editor. For more information on human task artifacts, see Writing a Human Task Artifact.
Creating a human task artifact
- Start Eclipse, go to File>New>Other and select Human Task Project.
- Fill in the following details in the form that appears on the wizard and click Finish.
- Project Name: humanTaskProject
- File Name: newfile
- Task Name: OrderApproval
- Target Namespace:www.wso2.org
- Once the project is created, you will the Human Task GUI editor similiar to the screen below with the sections of your .ht file listed out.
Expand the Task Properties panel and do the following:
Change the name of the task.
Add documentation for the task.
Set the priority of the corresponding task. For this field, you can either add an Xpath expression or an integer.
Expand the Task Input panel and do the following:
- To add a new input data mapping, click the + button on the top left side and fill in the required details (element name and data type). The presentation parameters are auto-generated according to the element name you provide.
- To delete an input data mapping, click on the delete button corresponding to the relevant input.
Expand the Task Output panel and do the following:
- To add a new output data mapping, click the + button on the top left side and fill in the required details (element name and data type). The presentation parameters are auto-generated according to the element name you provide.
- To delete an output data mapping, click on the delete button corresponding to the relevant output.
- Set the callback service properties. The values for Callback Service Name, Callback Operation Name and Callback Service URL are properties of the callback WSDL and the values you provide will deal with the callback WSDL file directly.
Expand the Presentation Elements panel and do the following:
- Set the Display Name, Display Subject and the Description of the task. These will be shown as the task info in BPS.
- The presentation parameters of the the task are auto generated according to the inputs and outputs.
In this section, you can do the following:
- Assign different users or roles as different stakeholders to this task. For example, you can add the users with the role name ‘clerk’ as potential owners of this task by filling out the Potential Owners field. In this sample you have to first select the Role and enter the user role name "Clerk". If you are assigning a user as an expression you can add it using XPath. The Xpath suggestions for the corresponding task will appear when you start entering it to the expression field.
Note: To add another task, you can select the + button next to the task tab and add a new task. All the tasks can be viewed as tabs on top of the UI. To delete a task, click the X sign on the task tab and delete the task.
Deploying the artifact
To deploy the artifact directly to WSO2 BPS, do the following:
- Right-click on the project.
- Select Export Project as a Deployable Archive. The project export dialog box will appear.
- Provide the location you want to save the artifiact in and click Finish. This will generate a .zip archive that can be deployed directly in WSO2 BPS.
- Start the WSO2 BPS server and login to the management console.
- Navigate to Add under Human Tasks and upload the human task zip that you just exported.