Thursday, July 01, 2010

Signal Activity in SOA Suite 11g

In this exercise we will learn about the Signal activity ,one of the new activity that has been added in SOA Suite 11g.

Software requirement is

SOA Suite 11.1.1.2+
Jdeveloper 11.1.1.2+

About
========

Basically we have two kind of process synchronous and asynchronous process.
Synchronous is one in which the client wait for the response and asynchronous
is one where in client fire and forget.

But there can be also a scenario where in client wanted to call a process and when the called process
executed halfway the client wants the callback to resume its execution in parallel with the invoked process.
In that scenario we can use signal which can signal the master process in the midway of called process and
do the execution of master and called process parallely.

IT will be useful in scenario where in there are multiple partnerlink and MAster bpel process is waiting for all
of them/some of them to complete and proceed.

I am not sure if i have made it very clear but it will be very clear if you will follow this document and analyse
it yourself

Procedure
========

IN this exercise we will try to create a slave BPEL process and a master BPEL process.

Master BPEL process will call the Slave BPEL process.

This will involve lot of activities so i will just paste the visual diagram of how the slave and master BPEL will look like

First of all Slave BPEL Process
=======================




This is how my process will look like(my slave process is BPELProcess1)

If there is some confusion in the screen shot then i will explain all activities.

First is receiveInput which initiates the process

Second Activity is Assign

This is a simple assign activity which copy input to output variable.

Next is Receive Signal activity




Then it is wait activity in which i have specified a time period of 5 second.


Again next is a Signal activity




Then there is again a wait activity in which i have specified a time dealy of 25 seconds

Finally we have the callback client which marks the end of the slave process.


Now once this process is complete deploy this process because we will use the wsdl of this process in our master process.



Master Process
=============

My Master BPEL process will look something like this




The activities are first receiveInput to start the process

Then next is assign activity where in the input variable is assigned to the input for Partnerlink.

Next is signal activity





Then its invoke which is calling the Slave Process
Again there is a Receive signal activity





Next is an assign activity where in i am assigning some string value to the output variable.


Finally there is a call back client which marks the end of the master BPEL Process.


Now again deploy the master BPEL process.


Now invoke the Master BPEL process and analyse its output.


This is the master BPEL process response






and this is the slave BPEL process instance which is created.In my case slave BPEL process is BPELProcess1




If you will analyse the process carefully and the timing of execution of each activity you will find that the slave bpel process is signalling the master bpel process before calling the

wait activity and hence the execution goes now again to master BPEL process ,Please check for the timing and you will find what is the importance of this activity.

Apart from the use case of signal just check out the time period this process tooks to completes ,SOA suite 11g is too fast :)

No comments: