Wednesday 1 May 2013

Unable to call a Business Rule Before an Initiator Task in a BPM Composite

We use Oracle BPM Studio to develop BPM Composites.

JDeveloper needs a BPM Plugin/Extension before you can start designing a BPM process.

Various plugin/extension available for JDeveloper could be downloaded here.

 

Quiet Often a BPM process starts with an Initiator task. The purpose of this task is to start an instance of the BPM Process at runtime. This task is also responsible for recieving the necessary inputs from the client process which is needed to start the BPM Process.

 

 

A typical requirement could be to execute Business Rules Task before the Initiator task of a BPM 11g Process. 

 

And why would you like to do that?

 

 

Your implementation might require to get the User local and language preferences from a Centralized rules repository even before a Business Process instance starts. 

 

 

The simplest and obvious way to achieve this is to store all user's locale and preference information in a repository and fetch it at run-time based on the user's credential automatically, even before user supplies any input and starts the business process

 

Now here's the problem

 

Generally a Business Rules Task works fine if placed anywhere else in the BPM process but if you try to use it before Initiator Task, It fails with the following exception and a faulted instance is seen in Enterprise Manager

 

------------------------------------------------------------------------------------------------------------------------

javax.xml.xpath.XPathExpressionException: ORABPEL-77005 Uninitialized data element.
DataOutput minuteSheetObject is not initialized in flow element Initiator Rule.
Make sure to initialize DataOutput minuteSheetObject before using it in flow element Initiator Rule.

------------------------------------------------------------------------------------------------------------------------


Workaround

If this issue is impacting your implementation you can try these steps as a workaround

 

 

Try to replace the Initiator Human task by a newly created human task of Initiator Type.(The main difference is that the parameter was defined when the human task was created and not by adding it to the existing human task (Step 4-5 below)


1. Edi the properties of the activity "Initiator task"
2. Click on the "Implementation" tab
3. Click on the green "+" near the Human Task. A "Create new Human task" dialog pops up.
4. Click on the "+" near the "Parameters" to add a new parameter .
5. Drag the "minuteSheetObject " instance variable to the parameters list and check the "Editable" checkbox.  Click ok  twice.
6. Complete the flow and deploy the project
7. Test the project with a sample payload.

No comments:

Post a Comment