User Task Rollback
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2015 08:25 AM
I am considering activiti 5.15 for designing business process for one of RFP. The process is pretty straight forward, it consists of number of "User Taks" with role based assignments. However there is one requirement from client which I am unable to map to Activiti features. Client wants that an admin user should be able to rollback any "User Task" to any of the previous stage at any point of time.
For example, following is my process, where "A", "B", "C" and "D" are user tasks
start –> A –> B –> C –> D –>end
Client want that at any point of time during a single process execution, an admin user should be able to rollback workflow execution from state "D" to any of "A" "B" or "C".
Is that possible in Activiti?
Regards,
Javed
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2015 02:30 AM
I see 2 possibilities:
- process design - you can change process design to allow return from D to A,B,C. (use exclusion gateway based on decision taken in D)
- change execution activity to the A,B,C - there is no API for that but implementation is simple.
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 02:51 AM
I tried with your first suggestion of changing "process design" to accommodate possible rollbacks, but the problem I am facing is that the number of executions exponentially rise due to multiple possible rollbacks. This is resulting in very complex workflow process definition.
Can you elaborate a little bit more on second suggestion? How can I change execution activity at runtime?
Regards,
Javed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 08:15 AM
It's possible to change the activity id of an execution and therefore it's possible to move the state back to another user task.
We don't support this through our api currently, but it's possible to write a custom command to accomplish this.
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2015 08:47 AM
So, are you suggesting to update the underlying database directly? Won't there be any repercussions?
Regards,
Javed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 10:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 11:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2015 04:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2017 01:42 AM
is any code snippet for this question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2017 03:16 PM
Something like this should work....
1. create a command:
/**
* @author Greg Harley - BP3
*/
public class MoveTokenCmd implements Command<Void>, Serializable {
private static final long serialVersionUID = 1L;
protected String executionId;
protected String targetActivityId;
public MoveTokenCmd(String executionId, String targetActivityId) {
this.executionId = executionId;
this.targetActivityId = targetActivityId;
}
public Void execute(CommandContext commandContext) {
ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(this.executionId);
execution.setActivity(execution.getProcessDefinition().findActivity(this.targetActivityId));
AtomicOperation.TRANSITION_CREATE_SCOPE.execute(execution);
return null;
}
}
2. Call the command from the management service:
// Set the new activity
managementService.executeCommand(new MoveTokenCmd(executionId, targetActivityId));
Obviously you will need to have the target activity id and execution id, but I will leave that for you to handle.
Cheers,
Greg
