...
...
...
...
...
...
...
...
...
...
Business processes cannot always proceed in a fully automated manner. They need human interaction as a means of decision making, error handling and exception cases. For example, canceling a flight due to a strike or bankruptcy, deciding whether to accept the claim based on the requested amount etc. Human tasks provide the specification to define tasks performed by human beings.
Sample
...
scenario
When a user requests a claim to be approved by the system, the system automatically approves claims under an amount of 1000 .This is a simple BPEL process. If the claim exceeds 1000, it will be handed over to the regional clerk who checks the claim amount along with the user information, decides whether or not to approve it, and the final decision is sent to the user. So when the claim is higher than 1000, it will be processed as a human task. The sample process is shown below.
...
The basic process is designed as a normal BPEL process with an IF component. For human tasks, we use the BPEL4PEOPLE activity remote task. It will get the input from the claim approval request such as the name and amount, and the output is sent via a claim approval callback service as true or false. The user can then see the final decision. This process needs some presentation elements. Human tasks are implemented as jsp JSP pages.
The BPEL process is implemented using the BPEL4PEOPLE activities and deployed into the server. Human tasks have to be deployed as a separate process. Since there is no tool to create a human task workflow, all the steps have to be done manually. However, there is a predefined package structure which makes the work easier. As an initial step, you should create a package structure in your local directory.
Package structure of an HT artifact
There are four components in the HT package.
Table of Contents | ||||
---|---|---|---|---|
|
.ht file
The .ht file contains the information about the human task of the BPEL process. It is an xml based file consisting of a predefined set of human task description elements. The table below shows the basic elements and their descriptions with some examples from the ClaimsApprovalTask sample.
...
<htd:humanInteractions>
...
<htd:import>
...
Used to import appropriate wsdl files. You should correctly specify the name spaces.
Example:
Code Block | ||
---|---|---|
| ||
<htd:importnamespace="http://reminder.sample.humantask.wso2.org"location="OrderProcessReminder.wsdl"importType="http://schemas.xmlsoap.org/wsdl/"> |
...
<htd:logicalPeopleGroups>
...
Used to specify logical people groups used in an inline human task or a people activity. The name attribute contains the name of the logical people group. The name must be unique among the names of all logical people groups defined within the <htd:human Interactions> element.
Code Block | ||
---|---|---|
| ||
<htd:logicalPeopleGroups>
<htd:logicalPeopleGroupname="regionalClerks">
<htd:documentationxml:lang="en-US"> |
The group of clerks responsible for the region specified.
Code Block | ||
---|---|---|
| ||
</htd:documentation>fd
<htd:parametername="role" type="xsd:string"/>
</htd:logicalPeopleGroup> |
...
<htd:tasks>
...
Info |
---|
This topic explains how to write the human tasks yourself and describes the various configurations you can use. You can view a completed version of the human tasks configuration in the |
Package structure of an HT artifact
There are four components in the HT package.
Table of Contents | ||||
---|---|---|---|---|
|
.ht file
The .ht file contains the information about the human task of the BPEL process. It is an XML-based file consisting of a predefined set of human task description elements. The table below shows the basic elements and their descriptions with some examples from the ClaimsApprovalTask sample.
Element | Description | |||||
---|---|---|---|---|---|---|
<htd:humanInteractions> | Contains declarations of elements from the WS- HumanTask namespace, that is <htd:logicalPeopleGroups> , <htd:tasks> and <htd:notifications> . | |||||
<htd:import> | This is used to import the appropriate WSDL files. You should correctly specify the name spaces. Example:
| |||||
<htd:logicalPeopleGroups> | This is used to specify logical people groups used in an inline human task or a people activity. The name attribute contains the name of the logical people group. The name must be unique among the names of all logical people groups defined within the
| |||||
<htd:task> | Used to provide the definition of an inline human task. The name attribute specifies the name of the task. The name must be unique among the names of all tasks defined within the It also consists of the
| |||||
<htd:interface> | Specifies the port types and operations of the human task.
| |||||
<htd:peopleAssignments> | Used to assign people to process-related generic human roles.
| |||||
<htd:tasks> | Specifies the human tasks used in the business process.
| |||||
<htd:task> | This is used to provide the definition of an inline human task. The name attribute specifies the name of the task. The name must be unique among the names of all tasks defined within the It also consists of the
| |||||
<htd:interface> | Specifies the port types and operations of the human task.
| |||||
<htd:documentation> | Provides annotations for users. Example for WS-HumanTask 1.1 - WS-HumanTask Task Definition | |||||
<htd:from>
<htd:argument> | From element used to assign people for roles which have been specified in the business process. Argument element will pass values used in the people query.
| |||||
<htd:peopleAssignments> | Used to assign people to process-related generic human roles.
| |||||
<htd:documentation> | Provides annotations for users.
| |||||
<htd:from>
<htd:argument> | From element used to assign people for roles which have been specified in the business process. Argument element will pass values used in the people query.
| |||||
<htd:presentationElements> | Specifies the user interface for human tasks or how the user interacts with the human task.
| |||||
<htd:notifications> | Used to provide the definition of an inline notification.The name attribute specifies the name of the notification. The name must be unique among the names of all notifications defined within the
|
...
You can have one or more WSDL files which have been used in the BPEL process. You can have a composite WSDL addressing many web services. Claim Approval task has one composite WSDL.
Web folder
There are four .jsp files inside the web folder. Three .jsp files end with:
- <TaskName>-input.jsp
- <TaskName>-output.jsp
- <TaskName>-response.jsp
<TaskName>-input.jsp
The input.jsp file uses the (OMElement) request.getAttribute("taskInput")
attribute to obtain the task Details details of the OMElement. This is inserted into the JSP context from BPS. The input.jsp file is used to show the task information to the task user.
...
Code Block | ||
---|---|---|
| ||
createTaskOutput = function() { }; |
This should provide the corresponding XML string expected by the task operation.
...