AnsweredAssumed Answered

Undo a task via a boundary event

Question asked by cgiuliano on Jul 11, 2016
Hi everybody,
I've been asked for a way to give a power user the means of "undoing" the last task approval in a workflow, should the user realize that he/she made a mistake.
In more realistic terms, I'm looking for an easy way to change a workflow's route. For instance, task2 has just been approved by userA, so now the task3 has been assigned to userB: is there a way to cancel task3 and send back task2 again to userA?

I've been "playing" a lot with boundary events and now I'm able to cancel task2 by sending a message to the workflow (I created a web script that sends the given message to the specified workflow instance).
My problem is that I want to mark the cancelled task as complete adding some specific comments (e.g. "Cancelled by supervisor on request of …"), so that the history of the process instance is complete and clear.

I haven't found any way to trigger a task event (for instance the "delete" event) when the task of the subprocess container is about to be cancelled by the boundary event. I'd just need to set two task properties before forgetting about the cancelled task.

I'm using Activiti 5.13 embedded in Alfresco CE 4.2.e

Any idea?

Thanks a lot to everyone.