Showing posts with label WSO2 BPS. Show all posts
Showing posts with label WSO2 BPS. Show all posts

Thursday, March 19, 2009

Adding BPEL features to WSO2 WSAS/ESB

A few days back, WSO2 has released carbon feature packs which allow users to integrate various functional components into their existing WSO2 products. I blogged about plugging in service hosting components into ESB while we were preparing for carbon release. With the carbon feature packs, now it is much more easier to add the functionalities what you want.

WSO2 BPS provides the facilities to execute business processes written using the WS-BPEL standard. BPEL feature pack enables the business process management inside your WSO2 WSAS or ESB instances.
Let's see how BPEL features can be added to WSO2 WSAS or ESB.

Pre-requisites:
Install WSO2 WSAS-3.0.1 or WSO2 ESB-2.0.1

Step 1
We are hoping to install BPEL features into WSAS or ESB. Therefore, download BPEL feature pack from here.

Step 2
Unzip the downloaded feature pack into a directory in your file system (suppose it is $BPEL_feature_pack_home)
You will see two sub directoris inside the extracted zip file, plugins and repository.

Go to $BPEL_feature_pack_home/plugins/ directory and copy all the jars to WSAS_HOME/webapps/ROOT/WEB-INF/plugins/ directory. (WSAS_HOME is the root directory of your WSO2 WSAS instance)

Then, go to $BPEL_feature_pack_home/repository directory and copy the contents to WSAS_HOME/repository.

Step 3
Restart WSO2 WSAS and access management console. You will see the BPEL features shown in the left menu as follows.



Thats it. We have installed BPEL features into WSAS. You could follow the same steps to install BPEL features into WSO2 ESB.

Tuesday, February 17, 2009

How to deploy WSO2 BPS on Apache Tomcat

WSO2 DOES NOT ENCOURAGE INSTALLING WSO2 BPS ON TOP OF OTHER APPLICATION SERVERS. WSO2 HAS DECIDED TO DROP SUPPORT FOR WEBAPP DEPLOYMENT MODE OF THE WSO2 PLATFORM AND PRODUCTS.





WSO2 Business Process Server (BPS) -1.0 is the latest member of WSO2 SOA platform. I have demonstrated a basic scenario using WSO2 BPS standalone distribution in a previous blog post. WSO2 BPS (and all other carbon based products) can be deployed in most of the servlet containers with a few configuration steps. Lets deploy WSO2 BPS on Apache tomcat 6.*.

Step 1
Download WSO2 BPS-1.0 from here. Extract the downloaded zip into a directory. Copy conf, database, repository and resources directories in to a new folder. Say it is carbon-repo (i.e:- C:\bps\carbon-repo)
Also, create a new directory, lib\extensions under carbon-home.

Step 2
Lets refer to your tomcat installation directory, CATALINA_HOME. Go to CATALINA_HOME\webapps directory and create a new folder, bps.
Now, copy wso2bps-1.0\webapps\ROOT\WEB-INF to CATALINA_HOME\webapps\bps

Step3
We need to enable https in tomcat. Therefore, edit CATALINA_HOME\conf\server.xml by adding the following entry.

<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true" SSLEnabled="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile = "C:\bps\carbon-repo\resources\security\wso2carbon.jks"
keystorePass="wso2carbon"/>

Make sure to give the exact location of wso2carbon.jks as highlighted above.

Step 4
We have done the configurations required in tomcat. Now, we must do the necessary configurations in a set of config files shipped with WSO2 BPS. We will update carbon.xml, axis2.xml, registry.xml and user-mgt.xml which can be found at carbon-repo\conf directory.
First, open carbon.xml and update the ServerURL element as follows.

<ServerURL>https://localhost:8443/bps/services/</ServerURL>

Note that we have configured tomcat to run on 8443 port.
Save and close carbon.xml.

Open registry.xml and update DB URL as follows.
<url>jdbc:derby:C:/bps/carbon-repo/database/WSO2CARBON_DB;create=true</url>

Now, open user-mgt.xml and update database URL as follows.

<url>jdbc:derby:C:/bps/carbon-repo/database/WSO2CARBON_DB;create=true</url>

Make sure to specify the absolute path of the WSO2CARBON_DB in both of the above elements.

It is required to change the contextRoot in the service path of axis2.xml. Change it to match with the web application directory name we have given in step2. In our case, it is bps.

<parameter name="contextRoot">/bps</parameter>

We must change the http and https ports in In Transports section of axis2.xml as follows.

<transportReceiver name="http"
class="org.wso2.carbon.core.transports.http.HttpTransportListener">
<parameter name="port">8080</parameter>

</transportReceiver>

<transportReceiver name="https"
class="org.wso2.carbon.core.transports.http.HttpsTransportListener">

<parameter name="port">8443</parameter>
</transportReceiver>

Step 5
We have almost completed the required configurations. Before starting tomcat with those changes, we need to do one more change. Due to a bug in BPS-1.0, we must copy org.wso2.carbon.geronimo.jta.1.1.spec-1.1.jar (which is available at the lib\extensions directory of the WSO2 BPS binary distribution) to carbon-repo\lib\extensions and CATALINA_HOME\webapps\bps\WEB-INF\lib directories.

Step 6
Now, open a new command window and change the directory to CATALINA_HOME/bin.
Define an environment variable called CARBON_HOME and set the path to your carbon-repo directory.

In windows; set CARBON_HOME=C:\bps\carbon-repo
In linux; export CARBON_HOME=\home\user\bps\carbon-repo

Start tomcat from the same command window/shell.
catalina.bat run

WSO2 BPS will be started successfully. You can access the management console using https:\\localhost:8443\bps\carbon

Friday, February 13, 2009

A quick look at WSO2 Business Process Server (BPS)

WSO2 Business Process Server (BPS) is the newest member of WSO2 SOA product suite. It is developed on top of the revolutionary WSO2 Carbon platform hence the components of WSO2 ESB, WSO2 Web services application server (WSAS) can easily be plugged in.
WSO2 BPS provides the facilities to execute business processes written using the WS-BPEL standard. It uses Apache ODE as process server engine.
I'm going to demonstrate how a simple BPEL package will be deployed in WSO2 BPS and some of the features such as process instance creation and process summary statistics.

Step 1
Download WSO2 BPS-1.0 from here. Extract the downloaded zip into a directory. We will refer to the extracted location as BPS_HOME

Step 2
Start business process server by running wso2server.bat{sh} which can be found at BPS_HOME/bin

Step 3
Access BPS management console using https://localhost:9443/carbon. Log in to management console using the default administrator credentials, admin/admin
BPS Home page will be displayed as follows.



Step 4
We are going to deploy a new BPEL package. BPEL package is a ZIP archive with all the relevant deployment artifacts. BPEL package should contain the deployment descriptor, one or more process definitions(.bpel or .cbp), WSDL and XSDs. You may find more information about these artifacts in Apache ODE user guide.
In this demonstration, I will use a sample BPEL package (HelloWorldNew.zip) used for testing purposes. You can download it from here.
Now, select Business Processes --> Add BPEL in the left navigation menu of WSO2 BPS management console. You will be directed to New BPEL Package page. Browse the downloaded HelloWorldNew.zip file in your file system and click on upload.
You will see the confirmation message if the deployement is successful.

Step 5
We have completed adding a new BPEL package. You can find the deployed package in the Deployed Packages page as follows.



Step 6
When you upload a new BPEL package, the associated business process will be created and will be listed in Deployed Processes page. You can find the process definition and more details of the process by clicking on the process ID.



Step 7
When a new BPEL package is deployed, the services which are defined as partner links in the process definition (services participating in a particular BPEL process) will be listed in the Deployed Services page as shown below. You will notice the HelloWorldNew service at the top of the table.



Step 8
Now we can create process instances by invoking this HelloWorldNew service. The simplest way of invoking the service is using "Try this Service" feature associated with the service. Click on Try this Service link in HelloWorldNewService.
You will be directed to Try the HelloWorldNewService service page where you can give any string value as input. Click on Process button to invoke the service.
With different string inputs, invoke the service few more times.

Step 9
After invoking the service, select Business Processes --> Instances in the left menu.
You will see the generated process instances as shown below.



With WSO2 Business Process Server (BPS), you can secure processes using WS-security and enable reliable messaging with minimum configuration steps. I will demonstrate these QOS (quality of service) features in a future post.

For more information about Business process server, access WSO2 BPS home page at WSO2 Oxygen Tank.