Tuesday, July 29, 2014

Groovy script in Script Task in Oracle BPM

Groovy script in ScriptTask/Activity in Oracle BPM


As specified in my previous post , you can add groovy script for a script activity in Oracle BPM 12c.

Using this, you can easily use if else, nested if, switch case etc, in  ScriptActivity.
You can avoid using multiple gate-ways in the flow by adding all the necessary conditions in groovy scripts.

In this example I will show a simple if else and a switch case.


You will see a new option "Go To Script" in BPM Process script activity. On clicking this, you will be shown a page where you can add your groovy script based on your use-case.



Adding couple of sample scripts here:

 


 

The use-cases above are self explanatory, you could add multiple conditions based on your needs.

Shoot me in the comments, if you need any help regarding this.


Sample project can be downloaded from here

Follow the blog to get to know about new features in Oracle BPM 12c.