This tutorial guides you on how to create a BPEL process and to assign a value in the request to the response using WSO2 Integration Studio. It walks you through the steps to demonstrate how you can assign the input string of the request message to the result string of the response message.
Before you begin,
- Download the product installer from here, and run the installer.
Let's call the installation location of your product the <EI_HOME> directory. This is located in a place specific to your OS as shown below:
OS Home directory Mac OS
Select the relevant WSO2 Integration Studio based on your operating system and download it from here.
The path to this folder is referred to as
<EI_TOOLING>throughout this tutorial.
Getting an error message? See the troubleshooting tips given under Installing WSO2 Integration Studio.
This tutorial includes the following sections:
Creating a BPEL Workflow
You will find a BPEL editor packaged along with WSO2 Integration Studio. This BPEL editor can be used to create a BPEL artifact easily.
To create a BPEL artifact, you should first Install WSO2 Integration Studio.
- Start Eclipse and navigate to File → New → Other .
- Search or scroll and find the BPEL category under the WSO2 folder, click BPEL Workflow , and click Next .
- Select Create new BPEL Workflow on the dialog box that appears and click Next.
- Enter the below details, and specify the Template (asynchronous process or synchronous process), and click Next.
- Project Name:
- Process Name:
- Process Namespace:
Synchronous BPEL Process
- Project Name:
- Provide the Maven information for the package and click Finish. You will now have a BPEL project according to the details you specified.
Click Open Perspective on the below message, which pops up.
You will not get this message if you are already in the BPEL perspective. You can view the current perspective from the below tab.
In the Project Explorer view, you view the BPEL diagram added under the project you specified and the default diagram will open up along with a Palette. You can use the Palette to drag and drop artifact symbols to create the desired diagram.
Creating the artifacts
Follow the steps below to create the required artifacts.
- Right click on the FIX_ME-Add_Business_Logic_Here element, and click Delete to remove it from the default diagram.
Drag and drop an Assign activity to the canvas and place it after the receiveInput activity.
Drag and drop this from the Actions section of the Palette.
Now, you have completed creating the activities of the BPEL workflow.
Configuring the receiveInput activity
- Click on the receiveInput activity and in the Details section of the Properties tab, select
clientas the Partner Link.
- Select Process as the Operation.
- In the Quick Pick: box, expand the process → EchoAsyncProjectRequestMessage → payload : EchoAsyncProjectRequest drop down and double click on the input : string option.
Configuring the Assign activity
- Click on the Assign activity, click Details in the Properties tab, and click New.
- In the From: box, expand the input : EchoAsyncProjectRequestMessage drop down and select the input : string option.
- In the To: box, expand the output : EchoAsyncProjectResponseMessage drop down and select the result : string option.
- Press Ctrl+S to save the variable mapping.
- Click Yes in the message, which pops up to initialize the variables.
Configuring the replyOutput activity
Click on the replyOutput activity and in the Details section of the Properties tab, select
clientas the Partner Link.
Select process as the Operation.
Now, you have completed the process logic. Next,
Double click process in the Quick Pick section to generate the input and output variables for this element.
Setting the port of the Partner Link for deployment
- Double click on the
deploy.xmlfile in the Project Explorer.
- In the
deploy.xmlfile under Inbound Interfaces (Services), click on the value in the Associated Port column and select EchoAsyncProjectPort.
Creating the deployable archive
Follow the instructions below to deploy a BPEL Workflow.
- Open WSO2 Integration Studio and save the BPEL Workflow you created.
Right click on the name of the BPEL Workflow in the Project Explorer window, and click Export project as Deployable Archive .
If you do not have the Project Explorer view, click Window → Show View → Other, select Project Explorer and open it.
- Click Browse, select a location to save the deployable archive file, which will be created, and click Finish.
This creates the ZIP file in the location you specified . This archive file contains of all the artifacts of your BPEL Workflow for you to deploy it in the Business Process profile of WSO2 EI.
Deploying the BPEL Workflow
After creating the deployable archive, follow the steps below to deploy the BPEL Workflow.
Start the Business Process profile of WSO2 EI.
- In a web browser, open the Management Console of the Business Process profile , and log in with the default credentials (username: admin and password: admin ).
Click Main → Manage → Processes → Add → BPEL , browse the ZIP file of the BPEL Workflow and click Upload .
You can find sample BPEL package ZIP files in the
<EI/HOME>/samples/business-process/bpeldirectory. Also, instead of using the Management Console, you can deploy a BPEL process manually by creating the
<EI_HOME>/repository/deployment/server/bpeldirectory, and copying the ZIP file to it. For instructions on preparing the process ZIP file, see Preparing for Process Deployment .
In the New BPEL Package window, browse and select the BPEL Package ZIP file and click Upload.
You view the deployed BPEL process listed under the Deployed Processes as shown below.
- Package Name: The name of the package containing at least the deployment descriptor and one or more process definitions (BPEL), WSDL and XSDs.
- Process ID: A unique ID to identify the deployed BPEL process.
- Version: If a package with an existing name is uploaded, the processes in the package will be versioned. All old processes in the package will be retired and new version deployed. Since there is only package-level versioning available, the new package should include all the processes defined in the old package, even though you may only need to update a single process in that package.
- Status: Status of the process. Can be either “Active" or “Retired".
- Deployed Date: Date and time of the package deployment.
- Manage: A newly-created process has status as “Active", which can be retired by clicking on the “Retire" link. Once a process is retired, a new instance of it cannot be created.
If you do not view the new process, refresh the browser or click Main → Manage → Processes → List → BPEL .
There are two ways to undeploy a BPEL Workflow.
- From the Management Console of the Business Process profile:
- Log in to Management Console, click Main → Manage → Processes → List → BPEL.
- Click the Package Name you want to undeploy.
- The Package Dashboard page appears. Click on the Undeploy link.
- By deleting the BPEL ZIP file from the file system.
- Delete the BPEL package from
- Delete the BPEL package from
Testing the output
Once the process is deployed successfully, follow the steps below to use the built-in Tryit Tool to send a request to the process.
- Log in to the Management Console using the
- Click Main → Manage → Services → List, and c lick the Try this service link of the corresponding service.
- In the Request section of the Try It Tool, replace the ? symbol with a preferred text.
- Click Send. You view the text you entered in the Request printed in the Response section.