Friday, August 30, 2013

Skipping Activites Execution in BPEL

Hi Guys,
I have been away from the blog for quite some time due to work and all.Finally got time to post new blog here. Today I will be explaining the new feature that is available from onwards.Some of you may already knowing it but for those who dont let me tell. You can now skip activities in your BPEL flow without using any switch or if condition. Oracle provides an extension that enables you to specify an XPath expression in an activity in BPEL versions 1.1 and 2.0 that, when evaluated to true, causes that activity to be skipped. This functionality provides an alternative to using a switch activity for conditionally executing activities. The skip condition for activities is specified as follows:

<activity bpelx:skipCondition="boolean-expr"/>

The bpelx:skipCondition attribute causes an XPath expression to be evaluated immediately upon creation of the activity instance. If the skip expression returns a false boolean value, the activity is executed. If the skip expression returns a true boolean value, the activity is completed immediately and execution moves to the activity immediately following that one.

This construct is equivalent to a switch/case structured activity with a single case element with a condition that is the opposite of the skip condition.

I will be demonstrating how to use it.Suppose in my code whenever I pass the input as 5 , I want to skip this invoke activity. Means I dont want this activity to get executed.

How do we go about it.Double click the invoke activity. Go to "Skip Condition" tab. Click on expression and write out your expression as shown in the screenshot:
Now, whenever I will pass the input value as "5", this invoke activity wont be executed.In the flow trace you will see this activity as "Activity Skipped".
There you go.In this way you can skip any activity you intend to skip without coding switch/IF condition in your BPEL code.

Hope this helps.

Happy Learning,
Cheers !!!


  1. I was looking for the above information...Thanks for sharing such a gr8 post with step by step process!... I Appreciate your efforts

  2. I was looking for the same solution. Thanks for writing such a good article.

  3. Hi, Karan, I have a question. I have set a BPEL skip condition on a foreach activity. I've specified that if the count of an array is equal to zero, to skip the activity. The activity is shown as skipped in the audit trail, but then in parenthesis has "pending". Is there a performance or code problem as to why the skipping is always shown as pending even though the activity has already been skipped? I'm not sure why it shows as pending while yours doesn't :/ Thanks and keep blogging!

    1. Hi Daniela,

      What version of BPEL and SOA suite you are using ?