Databases Reference
In-Depth Information
Cancelling or modifying a task
Another common requirement is to cancel or modify a task before it has completed
the workflow. If we take our example, suppose that having submitted the leave
request we changed our mind. Ideally we would like to be able to withdraw the task
or modify it before someone goes to the effort of approving it.
Withdrawing a task
You may remember that when we first added the task to the BPEL process we had
a field where we could specify a task initiator that we previously left blank. Well, if
you specify a task initiator they are effectively the
creator
of the task and have the
ability to withdraw the task.
To specify the task initiator, go back to your BPEL process and double-click on
the
Human Task
. This will reopen the Human Task Configuration window (see
Initializing the Workflow Parameter
section), click the icon to the right of the initiator
field, and this will launch the
Expression Builder
. Use this to specify the
employeeId
as the task initiator.
Now save the process, redeploy it, and run the process. Again, specify that the
request is for
jcooper
, then log into the worklist application as
jstein
. You should
notice that the task creator is
jcooper
. Don't approve the task, rather log out and log
back into the worklist application as
jcooper
.
This will take you into the
My Tasks
tab, which is probably empty, but if you click
the
Initiated Tasks
tab, then this will list all the tasks that you have initiated. If you
look at the task, you will see that you can perform a single action on the task, which
is to withdraw it.
Modifying a task
When we defined the task parameters on the task definition form, we had the option
to specify if the parameters are
Editable via Worklist
, and at the time we didn't
select this option. If this option is selected, then anyone who the task is assigned to
has the ability to modify the task payload, including the task owner and initiator.