The purpose of this exercise is to learn and practice advanced issues in BPEL processes of composing Web services and Human tasks,which is extended from Web Service Compistion 1 (Basic of Web Service Composition using WS-BPEL).
WS-BPEL is used for decribing Web service composition. However, in the execution of many service-oriented system, there are always human tasks for confirmation and so on. Therefore, BPEL4People is proposed for describe the human workflow as the extension of WS-BPEL. The BPEL4People specification is proposed by IT vendors like IBM and SAP, and standalized by OASIS. Using BPEL4People, human activities can also be described as service.(Refer to WS-BPEL Extension for People).
The input of human task of BPEL process is shown to the human who is in charge of the task. The output of human taks is directly inputed by human.
In the former exercises, we mainly provide exercises that only use language services for BPEL processes. However, human tasks should also be considered in the process to adjust the quality of language services in the real world. Therefore, in this exercise we consider the scenario in which human checks and correct the result of machine translation. Through this exercise, students can learn and practice how to create human tasks in the BPEL processes.
Refer to Exercise: Web Service Composition 1 for the appoach of creating BPEL processes.
1.Project Preparation
2.Add Human Task
Since the Eclipse BPEL Designer does not provide the visualized environment for human task, we edit "Backtrans.bpel" in the text editor. To add human task, the following items should be edited in the BPEL process:(1)add the namespaces for human tasks,(2)declare the usage of extention functions and define humanInteraction,(3)define human tasks.
We will use the example of composing translation service and human task for checking translation result to describe the above operations.
Added BPEL namespaces |
---|
<bpws:process exitOnStandardFault="yes" name="Backtrans" suppressJoinFailure="yes" targetNamespace="http://www.ai.soc.i.kyoto-u.ac.jp/process/Backtrans/" xmlns:b4p="http://www.example.org/BPEL4People" xmlns:htd="http://www.example.org/WS-HT" xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ns="http://www.ai.soc.i.kyoto-u.ac.jp/process/Backtrans/Artifacts" xmlns:ns0="http://langrid.ai.soc.i.kyoto-u.ac.jp/langrid-service_1_2/services/JServer" xmlns:tns="http://www.ai.soc.i.kyoto-u.ac.jp/process/Backtrans/"> |
Delaration of the extension functions, and the definition of humanInteraction |
---|
<bpws:process ... > <b4p:humanInteractions> <htd:logicalPeopleGroups> <htd:logicalPeopleGroup name="HumanTranslator"/> </htd:logicalPeopleGroups> <htd:tasks/> <htd:notifications/> </b4p:humanInteractions> <bpws:extensions> <bpws:extension mustUnderstand="yes" namespace="http://www.example.org/BPEL4People"/> <bpws:extension mustUnderstand="yes" namespace="http://www.example.org/WS-HT"/> </bpws:extensions> <bpws:import ...> ... |
Definition of human task |
---|
<bpws:extensionActivity> <b4p:peopleActivity inputVariable="translateRequest2" outputVariable="translateResponse2"> <wsht:task xmlns:wsht="http://www.example.org/WS-HT" name="TranslationTask"> <wsht:interface xmlns:ns="http://langrid.ai.soc.i.kyoto-u.ac.jp/langrid-service_1_2/services/JServer" operation="translate" portType="ns:Translation"/> <wsht:peopleAssignments> <wsht:potentialOwners> <wsht:from logicalPeopleGroup="HumanTranslator"></wsht:from> </wsht:potentialOwners> <wsht:businessAdministrators> <wsht:from logicalPeopleGroup="HumanTranslator"></wsht:from> </wsht:businessAdministrators> </wsht:peopleAssignments> <wsht:presentationElements> <wsht:name></wsht:name> <wsht:subject>Please translate this text.</wsht:subject> </wsht:presentationElements> </wsht:task> </b4p:peopleActivity> </bpws:extensionActivity> |
3.Set the deployment information
To deploy the BPEL process with human task, the following operations of deployment information is required:(1)add the namespaces for human task deployment,(2)describe the extension deployment information of human task and user information.
We will use the example of composing translation service and human task for checking translation result to describe how to set the deployment information.
Added namespaces in pdd |
---|
<pdd:process xmlns:bpelns="http://www.ai.soc.i.kyoto-u.ac.jp/process/Backtrans/" xmlns:pdd="http://schemas.active-endpoints.com/pdd/2006/08/pdd.xsd" xmlns:aeb4p="http://www.activebpel.org/b4p/2007/10/wshumantask/deployments" xmlns:htd="http://www.example.org/WS-HT" location="bpel/Backtrans.bpel" name="bpelns:Backtrans" platform="opensource"> |
Added contents of "pdd:extensions" |
---|
<pdd:process ...> ... <pdd:extensions> <aeb4p:logicalPeopleGroups> <aeb4p:logicalPeopleGroup location="/process/humanInteractions/logicalPeopleGroups" name="HumanTranslator" type="STATIC"> <htd:organizationalEntity> <htd:users> <htd:user>USERNAME</htd:user> </htd:users> </htd:organizationalEntity> </aeb4p:logicalPeopleGroup> </aeb4p:logicalPeopleGroups> </pdd:extensions> </pdd:process> |
4.Set the execution engine
In the BPEL process with human tasks, it is required to set users and user groups in the following steps.
Add Tomcat user |
---|
<?xml version='1.0' encoding='utf-8'?> <tomcat-users> ... <role rolename="testrole"/> ... <user username="USERNAME" password="PASSWORD" roles="testrole"/> ... </tomcat-users> |
5.Test
You can practice this exercise using the above steps for more language services provided by participants of the Language Grid. Try the following services as an advanced exercise.