This is the WSO2 Business Process Server documentation version 3.1.0.View documentation for the latest release.

Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

1. Download and setup WSO2 Developer Studio. (http://wso2.com/products/developer-studio)

2. Open Developer Studio and select File -> New -> Other.

3. On the dialog box that appears, select Composite Application Project and click Next.

4. Provide a suitable name for the Composite Application Project. Click Finish.

5. A Composite Application Project is created and appears on the Project Explorer.

6. Create a new BPEL project. Right-click on the project in the Project Explorer and choose New -> BPEL WorkFlow.

7. On the Create New BPEL Project wizard, select Create New BPEL workflow and click Next to continue.

8. Provide suitable names, a namespace and select the matching template for your BPEL process and project. 

In this example, we use BPELNumberAdder as the project name. Also provide a valid namespace as the process namespace. Since we are creating the synchronous business process, select the Synchronous BPEL Process template.

9. Click Finish to close the wizard.

Expand the WS_NumberAdderCarbon project folder in the Project Explorer to view another folder named BPELNumberAdder. The BPELNumberAdder project is used here for BPEL process development. 

From this point onwards you have to design your BPEL process by adding business logic to the BPEL process. In this guide we will be designing a simple process to add two integers.

10. Open the AdderProcessArtifacts.wsdl file in the BPELNumberAdder project in order to set input parameters. Click on the arrow next to Adder Process Request.

Another tab, Inline Schema of Add, appears. By default it will have a single variable named “input” with type string. Rename it as x and set the type to int.

11. You need to add another element. To add another element right-click on AdderProcessRequestType and add an element after it. Name it y and set the type as int.

12.  Now lets design the simple business logic. Open the AdderProcess.bpel file. You need to add business logic to where the FIX_ME-Add_Business_Logic_Here activity resides. Delete the FIX_ME-Add_Business_Logic_Here element. You will have the following process.

(Tip: to delete, right-click on the element and choose Delete)

13. Now you need to add an Assign activity in between the receiveInput and callbackClient activities. To add an Assign activity, drag it from the Action section of the Action Palette.

(Tip: another way to add an activity element to the editor is by right-clicking on the element and using the add-before option)

14. Now you need to configure the Assign activity. Click on the Assign element which is on the BPEL process and then click the Details tab in the Properties section.

Click New which will lead you to the following view:

15.  We will use an Xpath expression to compute the addition of two variables and assign the result to the output variable. To do that, choose Expression in the From drop down list and choose Variable in the To drop down list.

16. The Expression which we need to evaluate is $input.payload/tns:x + $input.payload/tns:y. Include this in the box below Expression Language.

17. Collapse the Output variable in the To section, and select result:string.

18. While you configure the variables, the editor will ask to initialize the variables. Click Yes. It will automatically generate an xml string for variable initialization.

The Properties window of the Assign activity will be as follows once you have completed the steps.

19. Now you need to define inbound and outbound interfaces. Open the deploy.xml file in the BPEL project. Choose AdderProcessPort as the inbound address port from the given list. The rest of the parameters will be automatically filled once you select it.

There will be no ports for outbound interfaces as we do not have external invocations in this business process.

20. Include the BPEL process as a dependency of the Carbon Application (WS_NumberAdderCarbon). To include it, open the pom.xml of the Composite Application Project and select BPELNumberAdder as a dependency. 

  • No labels