com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

BPEL Guide

The BPEL Quick Start guide explains how to set up and start the WSO2 BPS, model a BPEL process, deploy and test it using the WSO2 BPS management console. The guide has the following sections.

Setting up and starting BPS

WSO2 BPS setup is very simple. While more details of the installation can be found in the Installation Guide, this guide provides a basic summary to get you started fast.

  1. Ensure that the following are installed in your environment.
    • JDK 7 or 8.
    • JAVA_HOME environment variable is set to <JDK_HOME>. For example, JAVA_HOME=c:\Program Files\java\jdk1.7.0_71.
  2. Download the BPS binary distribution from http://wso2.com/products/business-process-server/.
  3. Extract the zip file to a folder which will be referred to as <PRODUCT_HOME> throughout the rest of this guide.
  4. Open a command prompt (or a shell in Linux) and go to the <PRODUCT_HOME>\bin directory.
  5. Start the BPS server by executing wso2server.sh (or wso2server.bat in Windows).
  6. The operation log keeps running until the server starts, which usually takes several seconds. Wait until the server fully boots up and displays a message similar to "WSO2 Carbon started in n seconds."

Modelling a BPEL process

  1. Download and setup the WSO2 Business Process Server tooling plug-in with Eclipse. 
  2. Open Eclipse and select File > New > Other.
  3. From the window that appears, select Composite Application Project and click Next.
  4. Provide a suitable name for the project. For the purpose of this example, name it as "WS_NumberAdderCarbon". Click Finish once done.
    The composite application project is created and you can see it on Project Explorer pane on the left of your Developer Studio screen.
  5. Right-click on the project which is on the Project Explorer pane and choose New > BPEL WorkFlow. If it does not appear there, click Other and search for BPEL WorkFlow on the search bar. 
  6. On the Create New BPEL WorkFlow wizard, select Create New BPEL workflow and click Next to continue.
  7. Provide suitable names, a namespace and select the matching template for your BPEL process and project. More information on the different templates can be found here. 
    For this example, the following values can be used: 
    • Project Name : BPELNumberAdder
    • Process Name : AdderProcess
    • Namespace : http://NumberAdder.com
    • Template : Synchronous BPEL Process
  8. Click Finish to close the wizard.The Project Explorer window and the AdderProcess.bpel file will look like the following.

    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.

  9. Open AdderProcessArtifacts.wsdl file in BPELNumberAdder Project and click on the blue arrow next to Adder Process Request. It will open another tab called InlineSchemaofAdderProcessArtifacts.wsdl.



  10. Rename the default variable named as "input" as x and change the type from "string" to int. 
  11. Add another element by right-clicking on AdderProcessRequestType>Add an element. Name it y and set the type as int. Now it should look like the follwing image.
  12. Now lets design the simple business logic. Open the AdderProcess.bpel file. You need to add business logic in the place of where FIX_ME-Add_Business_Logic_Here activity resides. Delete the FIX_ME-Add_Business_Logic_Here element. You will have the following process.

    To delete, right-click on the element and choose delete.

  13. Add an Assign activity in between receiveInput and callbackClient activities. To add Assign activity drag it from the Action section of the Action Palette.

    Another way to add activity element to the editor is right-click on element and use add-before option.

  14. Click on the Assign element and then click on Details tab in the Properties window. 
  15. Click on New which will lead you to the following view in the Properties window.
  16. We will use an Xpath expression to compute the addition of two variables and assign the result to the output variable. To do that select Expression from the From drop down list and select Variable from the To drop down list.
  17. Include the following expression in the box below "Edit the associated Xpath Expression".

    $input.payload/tns:x + $input.payload/tns:y 
  18. While you configure the variables, the a message will appear asking to initialize the variables. Click Yes. It will automatically generate an XML string for variable initialization. The Properties window of Assign activity should look like the following once you have completed the steps.
  19. Now you need to define inbound and out bound interfaces. Open the deploy.xml file which is in the BPEL project. Choose AdderProcessPort as the Inbound Address Port from the given list. The rest of the parameters will be automatically filled in once you select it. You do not need to specify ports outbound interfaces as we do not have external invocations in this particular business process.
  20. Include the BPEL process as a dependency of the Composite Application (WS_NumberAdderCarbon). To include it, open pom.xml of Composite application project and select the BPELNumberAdder checkbox as a dependency. 

Deploying and testing the BPEL process

After modelling the BPEL process, it can be deployed in the WSO2 BPS.

  1. In Developer Studio, right-click on the Servers window and select New>Server. If it is not visible, select Window>Show View>Servers.
  2. The New Server window appears. From the list, expand the WSO2 folder and select WSO2 Carbon 4.4 based server as shown below. Carbon 4.4 based server is selected here since BPS 3.5.0 is based on Carbon 4.0.2. If needed, specify the Server name here. In this example, we specify it as WSO2 BPS. Click Next.
  3. Set the CARBON_HOME by clicking the Browse button and selecting WSO2 Business Process Server_Home directory. Click Finish once done or Next if more settings of the server need to be configured such as the 'service port', 'web console port' etc.
  4. Once done, WSO2 BPS is added to Servers List as shown below.
  5. The next step is to deploy the composite application in WSO2 BPS. Go to WSO2 BPS Server>Add and Remove and select the WS_NumberAdderCarbon project.  The server will be automatically started.
  6. If the server does not get started automatically, right-click on the server and select Start. In the console window, note the server process's log. 
  7. The WSO2 BPS login page will open automatically in the default web browser. Login using admin as username and admin as password.
  8. Select Processes >BPEL>List from the Main menu. The Deployed Processes window opens with the AdderProcess deployed.

    The "Process ID" is generated in the format {"Process NameSpace"} ProcessName-VersionNo.

  9. Click the Process ID.

  10. The Process Information window appears with the details of the process. Click on the Try It link. 
  11. A browser window opens to enter the required input parameters. Enter the values and press Send to calculate the result. 

Alternatively, you can use the SOAP UI tool to test a business process. The SOAP UI application shows the request/response soap messages and is particularly helpful in error handling.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.