Monday, December 29, 2014

Expiration Date in BPM Process

Expiration Date in BPM Proces


This is one of the new feature that is added in Oracle BPM 12c.
Basically, some of you might have encountered a situation where there are many orphan instances or worklist tasks that are not updated/attented from quite sometime and you would want to get notified in such cases.

This Expiration Date field in Oracle BPM Process let's you set/update the expiration date time for the instance and once the particular time is reached, the bpm process throws a "Timeout" exception which can be caught and you can have corresponding compensation logic for the flow based on your design.

Here is an example process.

The process is pretty simple with a single Human Task. I have a Script Activity to set the expiration time. Process also has a Error Handling sub-process to catch the exception.




Expiration is part of Predefined Variables of Oracle BPM Process as shown in the picture below. Here I have set that CurrentDateTime + 2 Mintues using date function in xpath.





Now, when I invoke the process, expiration datetime is set in the ScriptActivity and then it goes to the HumanTask and waits. If the HumanTask in not acted for 2 mins, the system will raise a Timeout exception. Here is the screenshot of the ErrorHandling catch branch.





Here is the screenshot of the AuditTrail. You can see the system raised an Timeout exception after 2minutes and it has been re-covered since we have the catch branch in place.





Note:  This Expiration dateTime can be set in any activity, no need to use Script Activity explicitly. And at the same time, this Expiration dateTime can be overwritten multiple times in the process based on your design.

Shoot me in the comments if you need any further help.

Sample Project can be downloaded from here.

No comments:

Post a Comment