Withdrawing Tasks

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.

Concept(s)

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.

Details

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.

Example Process

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.

Comments:

Manoj, I'd add that a good practice in every BPM project would be to check the HumanTask "State" even before checking the outcome. A HumanTask might end not only with a WITHDRAWN, but also with an EXPIRED or with an ERRORED, or others.

Posted by Carlos Casares on February 28, 2012 at 08:14 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Technical and in-depth articles and samples on BPM 11g.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today