So how would the user choose the state (which activity execution should go to) without defined transition on the task?
In this use case, the user would have access to reject to any of the previously completed tasks. E.g. if we have a simple workflow like the following..
Start --> Task A --> Task B --> Task C --> Task D --> Stop
A user who is working on Task C should be given an option to reject to both Task A or Task B for the respective group to re-work the tasks and continue the flow from there.
The rollback feature is very hard to implement in process engine, because there would be too many situations to consider about. If it is necessary in your project, you could achieve this feature by yourself.
First get related task. cast it from Task to TaskImpl. invoke taskImpl.setSignalling(false); and completeTask(taskImpl.getId())
Second find the target activity. you could use processDefinition.getActivity(activityName).
Third move execution to target activity. execution.moveTo(activity);
At last create new task, by invoking activity.getActivityBehaviour().execute(execute);
1 of 1 people found this helpful
I think using transitions it is not as bad idea as it looks. Since either way you need to define the flows to give user correct options. With transitions you have it by default.
Of course you can do what HuiSheng described but in general using *Impl classes is not recommended.