By Manoj Das on Feb 18, 2012
Oracle BPM has a pre-defined action (also known as system action) that allows an user to withdraw a task. This article will provide a quick summary of how the BPMN process should handle withdrawn tasks.
The BPMN process should check the state of the task (and not the outcome) to know that the task was withdrawn.
Withdraw for Initiate Tasks
Withdraw for initiate tasks should be handled just like withdraw for any other task. Note that in the Initiate Task pattern the process is created before the form is launched; this is quite useful in initializing the form data. If abandonment of tasks is a particular concern, then instead of using the Initiate Task pattern, an UI external to the process should be used that kicks off the process via service or event interface.
Business Object based on State
To hold the state result of a task we will need data objects in the process to which we can assign the value. Therefore, we will need to create a business object corresponding to Task.StateEnum type. This can be easily done in the business object create wizard by selecting the Based on External Schema option, clicking on the ellipsis, and then selecting StateEnum as shown below.
In the process, after the task whose withdrawal we need to handle, we need to use a gateway to test the state and branch accordingly. A small example is shown below where if the task is withdrawn, we end the process.
Assigning the value of state
In the task's ouput data association, assign the value of execData.systemAttributes.state to the process data object meant for holding this value, in this example, taskState, as shown below.
Test for Withdrawal
The test for withdrawal would be of the form "taskState == State.WITHDRAWN". Note that since the State business object is based on an enumeration, we don't need to know the exact values and typing State. in the expression editor will show the different enumeration values.