Hello!
Is it possible programmatically set next activity for execution to some other activity from workflow definition? I mean, when is need to stop process instance, instead of using error-boundary events connected to the end event, just jump to the end activity? In book "Activiti in Action", there is listing 7.1, where execution path is chosen from service task. In example, there is selected one transition from 2 on current execution available. It would be great, if it would possible select in similar way the next activity using id or any transition existing on process definition.
I known, this is very bad design. We are evaluating possibility to change currently used engine to Activiti without re-drawing all workflows, but instead find the closest behavior to make migration simple as possible and skip manual work. In current engine every workflow definition contains optional activity, which is not connected to any other. Process instance checks some variable, if variable has some specific value like flag "stop", using engine APIs next activity is set optional activity. Since this activity is not connected to anything, process finishes. I read thread "Adding a dynamic step while the instance is in flight", where is very similar requirement, but in our case we do not need to execute anything - jump to the end would be enough.
Thanks for the advice - error-boundary event , of course, is the right solution.