Developing a simple Bpel project with eclipse Bpel Designer Plugin and WSO2 BPS Bpel Exporter Plugin
By Chathuri Wimalasena
- 11 Oct, 2009
This tutorial is written for eclipse 3.5 (Eclipse Galileo) and eclipse BPEL Designer plugin v. 0.4.0.
- Tutorial scenario
- Getting Started
- Writing a simple helloworld application using eclipse BPEL Designer plugin
- Deploying helloworld bpel in apache ODE
- Eclipse BPS BPEL exporter plugin
- Deploying in WSO2 BPS
- Tutorial Scenario
- Getting Started
- Java Development Kit 1.5 or above
- Eclipse SDK 3.5 (Eclipse Galileo)
- Apache Tomcat
- Apache ODE
- WSO2 BPS
- BPEL Designer plugin
- WSO2 BPS BPEL Exporter
- Eclipse BPS BPEL Exporter Plugin
Business Process Execution Language (BPEL), is an OASIS standard executable language for specifying interactions with Web Services. Processes in Business Process Execution Language export and import information by using Web Service interfaces exclusively. BPEL is an XML based Orchestration language. In an orchestration language, message exchange sequences are controlled by the orchestration designer.
WSO2 Business Process Server (WSO2 BPS) and Apache Orchestration Director Engine(ODE) are two BPEL compliant business process executable work-flow engines, which support composition of Web services by orchestrating service interactions.
Eclipse BPS BPEL Exporter plugin is to export a bpel project that was created by Eclipse BPEL Designer plugin. Artifact which is created from exporter plugin can be deployed in WSO2 BPS or in ODE.
Assume that you want to create a BPEL process using eclipse BPEL designer and deploy it in ODE or WSO2 BPS. This tutorial covers developing, deploying a simple helloworld BPEL application with the use of Eclipse BPEL designer and Eclipse BPS BPEL Exporter Plugin.
We assume that you have already installed following applications in your machine
3.1 Write a simple helloworld application using eclipse BPEL Designer plugin
Now lets focus on how to develop a simple helloworld application using Eclipse Bpel designer plugin.
After successfully installing eclipse BPEL Designer Plugin, you will have the option of selecting BPEL project as you select other types of projects in eclipse environment.
Before you start step 1, please make sure you run the ODE server at least for once. If not, it may not be visible in the Target Runtime window.
Go to new → other → Bpel 2.0 → Bpel Project and then click next.
Give the Project Name as HelloWorld, Target Runtime as Apache Ode 1.x Runtime. If it is not already in the drop-down list, click Modify under Configuration and in the Runtimes tab you can select Apache Ode 1.x Runtime. If you still cannot find Ode runtime, click new button and you will find Apache Ode 1.x Runtime. In each case, select Bpel 2.0 facet under Project Facet of the wizard you get when you click Modify button under Configuration and click ok.
Now the wizard will be as follows.
Then click finish.
Now you have an empty BPEL project as “HelloWorld” in your workspace. Right click on the project, select new → other → BPEL 2.0 → New BPEL Process File and click next. Fill in the Process Details giving BPEL Process Name as “helloworld”, Namespace as http:// helloworld and select the Synchronous BPEL Process from Template and click next. Select the project that we just created (HelloWorld) and click finish.
Your helloworld bpel process will be as follows.
And the workspace will be as follows.
When you select each UI component, you are able to view properties of each component by Properties window. If you cannot find properties window, go to Window → Show View → Properties. You may need to click other if you could not find properties window in the Show View pane.
Click on recieveInput and view at the Properties window and leave them as before.
Add an Assign activity in between Receive and Reply. Expand the Palette window and click Actions option and select the Assign action. Drag and drop it in between the Receive and Reply, as shown below.
In the Assign properties window select Details tab and click New. Then in the From attribute select Variable and 'input-paylaod-input:string'. At the To attribute also select Variable and 'output-payload-result:string' as showed in the image. Save the process.
3.1.1 Binding the Process
Now open the WSDL file in the Design view and add a New Service and a New Binding by right clicking on the design view. Select the Binding element in the properties window and in the General tab click Generate Binding Contents. Then you will see Binding Wizard will appear. At the Binding Details page select the Port Type as helloworldport and Protocol as SOAP and SOAP Binding Option as document literal. Give the Binding Name as helloworldbinding.
Then select the New Service in the properties window and change the name of the service as helloworldService. Then select the NewPort and at the properties window give the name as helloworldPort, select the helloworldbinding for the Binding from the Specify Binding window. For the Address field type “http://localhost:8080/ode/processes/helloworld” and select Protocol as SOAP. Now the design view of the WSDL file will be as follows.
3.1.2 Designing Deployment Descriptor
To deploy the process in ODE, you have to create a deployment descriptor file. For that right click on the HelloWorld bpel project and go to new → other → BPEL 2.0 → Apache ODE Deployment Descriptor and click next. In the pop up wizard, check whether the correct BPEL project (i.e. HelloWorld) is selected and then click finish.
Open the deployment descriptor file (deploy.xml) in the editor and at the Inbound Interfaces section under the Associated Port tab select helloworldport from the drop down list that will appear. Just click on the other tabs and you will see necessary details are filled automatically. Now deploy.xml will be as follows.
Now your process is ready to be deployed in ODE. To deploy it in WSO2 BPS, you have to make it a zip file. For that Eclipse BPS BPEL plugin will be helpful.
3.2 Deploy BPEL project in Apache ODE
Go to Tomcat webapps directory. There you will find a directory called “ode”. If you cannot find that directory, you have to run tomcat server at least for once, after copying ode.war file into webapps directory of tomcat. Go to tomcat/webapps/ode/WEB-INF/processes directory and create a folder copying .bpel file (i.e. helloworld.bpel), .wsdl file (i.e. helloworldArtifacts.wsdl) and ODE deployment descriptor file (i.e. deploy.xml) then run tomcat server if the server is not already in started state. When you start ODE (http://localhost:8080/ode) you will see extra file with the extension .deployed will be created in tomcat/webapps/ode/WEB-INF/processes directory. In the browser go to processes link of Apache ODE homepage and you will see helloworld process has been deployed (see below image).
In this tutorial we assume you have already installed Eclipse BPS BPEL Exporter Plugin in your eclipse.
Import the created BPEL project into the workspace if your workspace does not include needed BPEL project already. This can be done by clicking file → import → General → Existing Projects into Workspace and click next. Select the directory of BPEL project and click finish.
Right click on the BPEL project and select Export. In the Export window select WSO2 BPS Bpel Artifact under WSO2 Exporter and click next.
Select the BPEL project and location where you want to save the created artifact and click finish.
Now you will have the BPEL artifact that can be deployed in WSO2 BPS.
4.1 Deploy BPEL artifact in WSO2 BPS
Run WSO2 BPS by going to wso2bps-1.0.1/bin in the command prompt and run wso2server.sh / wso2server.bat. Go to https://localhost:9443/carbon and log as admin. Click Add BPEL under Business Processes and browse for the path of the BPEL artifact you just created from plugin and click upload. If there are no errors, you will get a message saying “upload successful”. From the services list, you can check whether the uploaded artifact is there.
You can try the service by clickng “Try this service” option.
Chathuri Wimalasena, Software Engineer, WSO2, [email protected]