Tuesday, October 6, 2009

Enabling BPEL into JBoss : Welcome to the Riftsaw Project

The objective of Riftsaw Project is to bring BPEL capabilities for JBoss Application Server. This project is build on top of Apache ODE, basically adding some features for JBoss App Severs as which will allow either JBoss ESB (Community based) and in the future JBoss SOA Platform(Enterprise SLA) to support BPEL out-of-the-box.


Another "Opensource" BPEL alternative


If anybody tell you that BPEL is an easy language to create the processes manually and if you believe, you are ready to believe in any tale! I tell you it because this is a kind of technology that you really need a graphical tool/designer.


The JBoss Community has adopted for many years the Eclipse to deliver JBoss Tools and now this set of plugins made by JBoss Team is already integrated with Eclipse BPEL Designer. This is a cool plugin and you will really need this feature into your Eclipse, otherwise create any simple BPEL process will be a really boring task.

Nevertheless we support BPEL Designer in JBoss Tools. You are able to use the NetBeans BPEL Desginer which is another really cool opensource alternative. I did some personal researching over BPEL support in NetBeans and it was a real good experience. For certain moments I thought that Eclipse could incorporate some ideas from NetBeans designer as well.

I recommend you install the JBoss Tool's 3.1.0.M3 plugins into your Eclipse 3.5 (Galileo). It will add the BPEL support into your Eclipse as well as the capacity to deploy the process besides editing the WSDLs visually. For more information about this see this link: https://www.jboss.org/tools/download/dev.html

Once you are aware that you really need a designer tool, let's try share with you some good information before you dive into BPEL Development; first of all there are certain resources and concepts that would make BPEL easier for every human. These are the following:
  • WSDL
  • XPath
  • XSLT
  • XML Schema
If you have a good background over those items above, BPEL will be incredibly easier for you, otherwise, I recommend you attend the "Webservices online training", this is one of the training offered in JavaPassion Website. In this training, you will have some good brief introductions about everything you need to be a BPEL Rock Star.

I've been listen many many times companies complaining about SOA Adoption independently of the technology vendor a very common problem is what I call: "The gap between processes and the bussiness components". This is the moment where your company spent thousands of US$ to discovery the company's processes. So many Six Sigma guys came to you company and told you everything that your company is doing wrong and **designed some proposals using BPMN** or any other notation of "How the company could/must work". At this moment you can see a huge interrogation in front of you while you are trying to figure out which glue you will use to put your processes working with your legacy COBOL, Java, .Net and a bunch of WebServices representations of these legacy components, have you think about that before?

BPEL could help you in 30% to 40% to solve these kind of problems. Once BPEL aims you think in "Composite Applications" which in general are many compositions of different services (keep in mind that it can be not only WebServices).


This technology is perfect when you must execute several services according some conditions or even some rules. BPEL allows you think in "Services Orchestration" at the same way you think when you are creating Swing UI using some graphical designer.

The RiftSaw/Apache ODE is an implementation of WS-BPEL 2.0 which is the newest specification definied by OASIS of the standard BPEL4WS (Business Process Execution Language for Web Services) 1.0 and 1.1. Red Hat counts with one contributor for this spec: Alejandro GuĂ­zar (JBoss, by Red Hat).

Thinking about Processes

I married about 1 year and I can still remember my wedding process. Several people were involved. A lot of parallel tasks, a lot of dependent tasks, timeouts, authorizations, rules etc! Now try imagining everything into a flow keeping in mind how you would organize your plans to get married and keep in mind that you have a lot of expecations, and everything must be perfect on time, saving costs and allowing everybody to be happy... Well, this is exactly what processes are trying to solve and provide to the companies globally speaking!


A Process is composed by a Sequence of many activities and those different activities can to perform particular actions, but always promoting a collaborating among them. Let's see some examples of this:

Getting Married Process -> Propose the Lady -> Request Parent's Authorization -> Organize the Party -> Invite People -> Organize Honey Moon -> Organize Bachelor Party -> Say Yes!


If everything in the sequence flow is true, congratulations, you will have a good chance to celebrate a nice wedding! Although a process must handle when something that you are not expecting to happen, for instance: "Bachelor Party denied", and than you might try several different actions, flows or even new sequences for it. :)

WS-BPEL 2.0 spec describes a process, the sequence, the activities that are part of , the faults, the exceptions, the alternative paths and everything you need to create a process.

Using JBoss technologies for BPEL

When we are working with BPEL, basically the majority of Tools generates a .bpel file, this is a XML File that describes the process itself. A BPEL Process represents several interations with a bunch of Webservices, then if the BPEL can invoke several WebServices, makes sense if the way to invoke a BPEL process execution would a WebService as well, for this reason each .bpel file, or process, will have a WSDL that will represent the Client invocation, as well as the response that will send after the process flow.

A BPEL Process is a sequence of activities inside some sequence, exactly as I said before, you may represent it graphically(IDEs) or programatically (XML), the following table will show the 2 action's categories :












Basic
Activities

Structured
Activities



  • invoke

  • receive

  • reply

  • assign

  • compensate

  • compensateScope

  • empty

  • exit

  • throw

  • rethrow

  • validate

  • wait





  • flow

  • forEach

  • if

  • pick

  • repeatUntil

  • scope

  • while






These activities are represented in the BPEL Palette, as you can see in the following image:

This is a simple blog entry, so it would be impossible describe BPEL in depth here. So I recommend you read some books and deeper BPEL Articles if you need more background on this technology. it will make you understand this entry much better.

Creating your first BPEL Project using JBoss Tools, RiftSaw and JBoss App Server 5.1

First of all you must have in your machine the following software:

* Eclipse 3.5 + JBoss Tools 3.1.0M3
* JBoss 5.1.0 GA
* JBoss Riftsaw M1

Installing Riftsaw

This came from README.txt:

The build.xml script in this directory is responsible for deploying the BPEL runtime and deployer to the JBoss AS,and the BPEL/ESB examples to the JBossESB environment.

1) Install JBoss5.1.0.GA and JBossESB4.6.GA, and follow the JBossESB instructions for installing it into JBossAS

2) Update the deployment.properties file to set the path to each of this installations

3) Run "ant deploy" to install the BPEL deployer and engine into the JBossAS

4) Start the JBossAS server

At this point, you can try out the examples in the RiftSaw/samples folder.

Alternatively, if you want to try out the BPEL/ESB examples, then:

6) Run "ant deploy-esb-examples" to copy the ESB/BPEL examples into the JBossESB samples.

7) Follow the $JBossESB/samples/quickstarts/webservice_esb_bpel instructions to run the example

One thing that you may ask yourself:

a) Why the Riftsaw is installed both in AppServer and the ESB Server ?
- Hide quoted text -

A: In my point of view you may think into a "process repository" or something like other vendors loves to call : "A process server", so the BPEL processes will be running into an exclusiv (or clustered or load balanced) instance of a JBoss AppServer, which will host the Riftsaw Engine, as well as the WSDLs that represents the processes.

In another hand you have the other part of your SOA solution, in that case in particular I am talking about an ESB! At this moment, JBoss ESB can host services that may put several BPEL processes to work together, for each BPEL Process you will have an 1-1 relation with a WSDL, once you will access a BPEL process of the same way you acess a regular WebService: Through an WSDL.

Depending of what you wanna do in terms of Orchestration you may count just with BPEL, however keep in mind that you will be limited into WSDL boundary, so if you need different protocols collaborating with each other

Now I will save your time! it's time to watch this tutorial to get some basics of BPEL Development using JBoss Tools + Riftsaw, click here to watch!

If you prefer, you may watch it here:

JBoss Riftsaw - Getting Started Tutorial from Edgar Silva on Vimeo.



Why is it useful? It shows how you can edit the WSDL that acts as the endpoint for the BPEL process, and also shows how you can create the Service, Ports, Bind for this WebService.

No comments: