Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Pages

Tuesday, March 26, 2013

WSO2 Tutorial - BPS

In this tutorial of the WSO2 path I'm working with the BPS version 3.0.0 and WSO2 Developer Studio version 3.0.0.

The objective of this tutorial is to show how to implement a simple process and deploy it in the BPS.

I'll use here a standard default installation of the server (no external DB for process management and so on)




I start with a new project of WSO2 type, BPEL workflow.

At the end of the wizard I find myself with a HelloWorld couple of classes of an example project that is not possible to eliminate without closing eclipse and deleting the files by hand, but apart from this quirk I'm set and ready to go.

I start defining the input variables of my process and the output. This is done in the WSDL definition file and I find all the bindings ready for me.

Than is time to go to the BPEL process and define the flow.

I can transform the dummy activity in 4 possible actions, but since none of those are of my use I get rid of it and insert an IF action.

In the condition is important to remember that to access the input variables I have to use the following syntax:

$input.payload/...

Fortunately the ctrl+spacebar gives hints but the "/" was hard to find in the manuals.

Each condition gets its assignment (in this example I just copy in the output a different input variable based on the path on the conditions, I'll post some more complicated in a second moment).
Making the assignment to the output variable I'm informed that the variable needs to be initialized and proposes me to do it for me (after having chosen "no" a couple of times and received a couple of errors I decided it was a good thing to accept the advise).
Also I have to be careful in selecting the destination and assigning the variable to the output and not to the "payload".

To deploy the easiest thing to do is to create a zip file from the project with the available function.

I already started my BPS server and I'm logged in the administration console (it is just the unzipped BPS distribution that runs out of the box).

I add a new process selecting the zip file.

It get deployed but ... I got an error .. yes I forgot to edit the deploy.xml so it's time for eclipse again choosing the correct "associated port" and I'm ready for a new deploy.

This time all goes well and I can test it with the internal test tool filling the XML payload and getting the expected result.

Very nice piece of technology.
Maybe a bit more documentation could be of use.




0 commenti: