Friday, 6 July 2012

Pick Activity in BPEL 11g

Pick Activity in BPEL

This activity waits for the occurrence of one event in a set of events and performs the activity associated with that event. The occurrence of the events is often mutually exclusive (the process either receives an acceptance or rejection message, but not both). 

If multiple events occur, the selection of the activity to perform depends on which event occurred first. If the events occur nearly simultaneously, there is a race and the choice of activity to be performed is dependent on both timing and implementation.
The pick activity provides an OnMessage branch. 

When you double-click the OnMessage icon in BPEL 1.1, the dialog shown in Figure A-24 appears.

Figure A-24 OnMessage Dialog

                    

In BPEL 2.0, the OnMessage dialog includes a Documentation tab and does not include a Skip Condition tab or an Assertions tab.

The two branches of the pick activity are as follows:

·        onMessage (automatically displays below the Pick activity icon)
Contains the code for receiving a reply, for example, from a loan service.
·        onAlarm (does not automatically display; you must manually add this branch by selecting the Pick activity icon and clicking the Add OnAlarm icon)
Contains the code for a timeout, for example, after one minute.

Whichever branch completes first is executed; the other branch is not executed. The branch that has its condition satisfied first is executed.

Figure A-25 shows the OnAlarm dialog of the pick activity in BPEL 1.1.

Figure A-25 OnAlarm Branch Dialog of a Pick Activity

                  
In BPEL 2.0, the OnAlarm dialog includes a Documentation tab and does not include a Skip Condition tab.

Note:
You can also create onMessage branches in BPEL 1.1 scope activities and onAlarm branches in BPEL 1.1 and 2.0 scope activities. Expand the Scope activity in Oracle JDeveloper, and browse the icons on the left side to find the branch you want to add.
If you add correlations to an OnMessage branch, the correlations syntax is placed after the assign activity syntax. The correlation syntax must go before the assign activity.

As a work around, perform the following steps:
1.    Create a correlation set in Oracle JDeveloper.
2.    Assign this to the OnMessage branch.
3.    Complete the remaining design tasks.
4.    Before making or deploying the BPEL process, move the correlation syntax before the assign activity in the BPEL source code.

Reactions:

0 comments:

Post a Comment