Modelling a BPEL Process
This blog post describes how to model a BPEL process via WSO2 Developer Studio.
As prerequisites you need to download [1], [2]
[1] WSO2 Developer Studio - http://wso2.com/products/developer-studio/
[2] WSO2 BPS 3.1.0 - http://wso2.com/products/business-process-server/
This shows a simple process to add two integers.
- Go to the Developer Studio dashboard and then click on Composite Application Project. Then give a project name.
- Then right click on the created CApp go to New -> BPEL Workflow
- Then from the wizard select option 'Create new BPEL Workflow' and click on Next.
- Give a name for the project, process and since this is a synchronous business process select 'Synchronous BPEL Process' as the template and click on Finish
- If you go to the project explorer you can see a process called Adding.bpel has been created and it will displays as follows.
- Now open the AddingArtifacts.wsdl file and go to the design view. Then click on the arrow next to Adding Request.
- Then a new tab will be opened named Inline Schema for AddingArtifacts.wsdl. Under the AddingRequest Type insert a variable called 'a' with the type int. Then right click on the AddingRequest Type and click on Add Element. Then add another variable called 'b' with the type int. Finally it will looks like below.
- Now we can design the simple business logic. Open the Adding.bpel file and then in order to add the business logic you need to select and delete the 'FIX_ME-Add_Business_Logic_Here' element.
- Then you need to add a Assign activity in between receiveInput and replyOutput, you can drag and drop from the Action pallet or right click Add-> Assign.
- Now click on the Assign and go to the properties window and select 'Details' tab then click on 'New'. Then select 'Expression' from the 'From' drop down and 'Variable' from the 'To' drop down. Then in the 'Edit the associated XPath Expression' type "$input.payload/tns:a + $input.payload/tns:b" and then select "result:string" under 'To' as the assigned variable.
- Then a pop up will ask to initialize the variables click on 'Yes'
- Now you need to define inbound and out bound interfaces. Go to the deploy.xml file which is in the BPEL project. Then select AddingPort as the inbound address port from the given list. Rest of the parameters will be automatically filled once you select it.