Saturday, October 30, 2010

Thursday, October 28, 2010

Understanding BPELMessageReceiver in BPS


/*Still unfinished stuff, will take time to finish it.*/
Once you invoke a bpel process in WSO2-BPS this is what happens.

It needs to invoke its business logic implemented in bpel. This is somewhat different and somewhat similar to invoking and invoking and Web-Service.
Invoking a bpel process means is just like invoking a WS. So you can use WS client or any other mechanism to call to the WS-interface which is defined by WSDL1.1.
Once the process is invoked, the org.wso2.carbon.bpel.ode.integration.axis2.receivers.BPELMessageReceiver handle the business logic.
Let’s first understand how the BPELMessageReceiver is executed.
Once you start the BPEL server (ODE server), org.wso2.carbon.bpel.ode.integration.BPELServerImpl#initBPELServer, the binding context for the server is set using org.apache.ode.bpel.engine.BpelServerImpl#setBindingContext. There we pass a org.wso2.carbon.bpel.ode.integration.BPELBindingContextImpl object. There org.wso2.carbon.bpel.ode.integration.BPELBindingContextImpl#activateMyRoleEndpoint -> org.wso2.carbon.bpel.ode.integration.BPELBindingContextImpl#publishAxisService -> org.wso2.carbon.bpel.ode.integration.utils.AxisServiceUtils#createAxisService. There the org.wso2.carbon.bpel.ode.integration.axis2.receivers.BPELMessageReceiver object is set as the message receiver for each myRole-endPoint.
So once you invoke a bpel process, BPELMessageReceiver take the responsibility of invoking the business logic.

What happens at org.wso2.carbon.bpel.ode.integration.axis2.receivers.BPELMessageReceiver#invokeBusinessLogic
org.apache.axiom.soap.SOAPFactory object is also created from inMessageContext, for partner service invocation.
There using the inMessageContext of the invocation, BPELMessageContext is generated. It also check whether the operation is in-only or in-out operation. Based on these kind of checkings it generates is custom message context. This is basically just a DTO used when invoking the business logic.

Then the business logic is handles based on whether the operation is in-only or in-out.

In both cases org.wso2.carbon.bpel.ode.integration.BPELProcessProxy#onAxisServiceInvoke is invoked. So let’s look at what happens at this method execution.

Inside org.wso2.carbon.bpel.ode.integration.BPELProcessProxy#onAxisServiceInvoke few important things happens.
One thing is transactionManager.begin() - It creates a new transaction and associate it with the current thread. Default transactionManager is configured org.apache.ode.il.EmbeddedGeronimoFactory in org.wso2.carbon.bpel.ode.integration.config.BPELServerConfiguration.

Then it invokes the BPEL process using the created odeMessageExchange. Here a java.util.concurrent.Future object as follows.

responseFuture = invokeBPELProcessThroughODEMessageExchange(

odeMessageExchange,

bpelMessageContext);

success = commitODEMessageExchange(odeMessageExchange);

So using responseFuture, process is invoked asynchronously and wait for the response if there is a response.
If there is a response, it’ll be handled.

Thursday, October 14, 2010

After One month of work...


It is exactly one month since I joined WSO2 Inc. Most of the time I blog about techno stuff. Felt should write some short non-techno stuff as well.
Regarding the SW development at WSO2 is a continuous learning process. Everyday I learn something new. That’s something I really appreciate. And it’s not just about the coding. There’s so many thing apart from coding to learn.

Apart from that, the company environment is almost a fun house. It becomes very noisy sometimes; people shouting, dancing, playing and do all the stuff. I still remember during the first carbon release, suddenly people start to sing, dance and after sometime go back to coding again. And it happens again and again :).

During the BB tournament

Normally if the my code logic start to go crazy, what I would do is; grab some food and play some table tennis, foosball or Guitar Hero or whatever. Then mind become clean and clear to think on what I was trying to figure it out. Company environment is that much free and flexible.

Some guitar heroes... :)
The communication is also open; happens often via different mailing lists for different areas. There’s a flat structure so anyone can fire their thoughts publicly and equally regarded. (I still don’t understand most of the discussions going on the mailing list; specially architectural stuffs :) ).

Sunday, October 3, 2010

Tips for Neural networks


I find these videos from Prof.S. Sengupta, Department of Electronics and Electrical Communication Engineering, IIT , will be very useful to get to know about Neural Networks with a maths-based perspective. http://www.youtube.com/watch?v=xbYgKoG4x2g