We have the following requirement. We have a manual task that should be either completed by a user , or if a specified time duration expires it should be automatically completed. We tried using jeopardy notification , but through the jeopardy notification automation we can't use the completeTaskOnExit in order to proceed the task. We also tried using a parallel flow , with the manual task in the first parallel flow and a timer delay on the second parallel flow , but we were not able to complete the manual task in the first parallel flow, when the timer delay expired.
If you have any experience regarding parallel flows , could you pls help?

but i am getting the following error : External object has wrong class (is class com.mslv.oms.automation.OrderNotificationContextBeanLocal, expected interface com.mslv.oms.automation.TaskContext) . If i use the following :
declare namespace context = "java:com.mslv.oms.automation.OrderNotificationContext"; i cannot use the completeTaskOnExit function in my xquery, and i get the following error :
Cannot find a matching 2-argument function named {java:com.mslv.oms.automation.OrderNotificationContext}completeTaskOnExit()
Can you please help?

Hi, took me a while to figure it out.
We were confronted with the same task on a past project.
We finally implemented a custom automator which cast the context object to TaskNotificationContext.
So that would be one option for you.

The reason why OSM invokes your automator with OrderNotificationContext is that in case of a multi-instance task, the jeopardy is raised only once at order level thus not connected to a specific task instance. However, there is a way to raise the jeopardy in the context of the current task by checking the "Raise a jeopardy for each branch check box".