Sunday, April 3, 2011

Sychronous and Asycnhronous BPEL Process.

ASynchronous process is one which you call need no wait for the response before proceeding further.You may just initiate the

asynchronous process and recive the response when you require it as part of your process.,hence you are not forced to wait for

the response .


Real life example of a Synchronous process: You call a friend and ask him to give you some information. While your friend is

finding out the information for you, you are on the call waiting for his response. Note that connection is not dropped


Real life example of an Asynchronous process: You call a friend and ask him to give you some information. You ask him to call

you back when the information is ready and you disconnect the call. When your friend is ready with the information, he calls

you and gives you the information. Note that you don’t wait for a response from your friend and connection is lost. When your

friend is ready, he has to establish a new connection and then provide you the information


Suppose there are two processes SynchronousBPEL Process and Asychronous BPEL Process.As the name suggest former one is a

synchronous and later one is Asychronous BPLE Process .Also there is a third process which we will call as Client.
The client invokes the above process.

Case 1 :Client Invokes Synchronous BPEL Process.
1. Client invokes synchronous BPEL Process.
2. Synchronous BPEL Process gets inititated and start its operation while client waits for the response time from the

Synchronous BPEL Process.
3. Synchronous BPEL Process complete its opetations and send a response back to Client
4. Client continues and completes its processing

Case 2:Client invokes Asynchronosu BPEL Process.
1. Client invokes an Asynchronous BPEL Process.
2 Asynchronous BPEL Proces gets instatiated and starts its operation while client also continues to perfrom its operatiobs.
3 Asychronous BPEL Process complete its operation and call back with the response the message .


What is the difference between synchronous and asynchronous bpel process?
The synchronous process defines one two way operation port to receive the request and send the response .
Using the invoke activity the client invokes the synchronous bpel process on this port and waits to recieve the response on

the same port .As soon as the client receives the response from the bpel process it continues with its flow .On the BPEL

process side ,the sycnhronous bpel process gets instantiated on receiving the client and sends back the reply using the reply

activity on the same port on which the client is waiting .

In case of Asynchronous processs it is two one way operation ports are defined to receive the request and send the response.
On the client side ,the client uses the invoke activity to invoke the asycnhronous bpel process and continues with the flow .
If uses the reveive acitvity to recieve the response later in the flow .
The asynchronous bepl process recieves the request on one port and sends back the reply from another port(call back port)
To send the responsse the asynchronous bpel proccess invokes the client on the callback port using the callback activity .

For example in the real time, if the client needs an approval ,synchronous process should be implemented .As the proccess has

to wait for the aprroval to proceed.

1 comment: