Thursday, June 09, 2011

Pick activity in SOA suite 11g -Sample

Pick activity is used when you have a business functionality where in you want to trigger a process on onset of several events.That is let suppose if you want to initiate a process as soon as a table is updated in database or a file is written in a local or a remote file location.That mean you basically have three adapter in your inbound operation.File adapter is listening to a local queue,FTP adapter is polling on a remote file location and db adapter is polling a database table.Now as soon as any one of them gets data your process should start.you can achieve this by using pick activity.In this exercise we will create a sample process and see how it works.

This is how my composite and my bpel process looks like.



There are few things that we need to take care of while configuring it.
First of all if you have created a pick activity for initiating a process on onset of data in different place you should not have an on alarm activity as it will not make a sense as your whole purpose is to wait of message to come from any mean,if you will specify a alarm activity you will probably get an error message while compiling this process.


Error(95): onAlarm is in pick with createInstance="yes". No alarms are permitted in this case

So you just need to remove your alarm activity to compile it successfully.

Further if you have not selected createInstance=yes you will again get one more compilation error

Error(59): Initial activity is invalid. An initial activity must be of a receive or pick activity.

Error: there is no receive activity that starts the process

To overcome this issue you need to select the create Instance in the following location



For configuring with each adapter we use onMessage block.

So in our case we have three adapter so we will use three on message block.

I will show one of the block as how it works

Interaction type will be PartnerLink.

IN partnerlink tab click on search button and choose the parnerlink you want to select.

Choose the opearation and create a variable to store that value as shown below.



Similary you can create other adapters also,Let me know if there is an issue.

3 comments:

Hari said...

Hi,
I am calling three different services by using pick activity,those will get response from DBAdapters.While implementing this scenario,I am getting receive conflict error.Any suggestion should be grately acceptable.

Hari said...

Hi,
I am calling three different services by using pick activity,those will get response from DBAdapters.While implementing this scenario,I am getting receive conflict error.Any suggestion should be grately acceptable.

Mikku said...

Use cor relation id to co relate the request and response for a particular set