cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 5.16 to Activiti 6.x migration ServiceTask

manojkumarurs
Champ in-the-making
Champ in-the-making

Hello Team,

Greetings.

We want to migrate activiti from 5.16 to 6.x version and I need an solution for Service Task implementation where we have more than one sequence flow.

Example:

public class ThrowsExceptionBehavior implements ActivityBehavior {

public void execute(ActivityExecution execution) throws Exception {
String var = (String) execution.getVariable("var");

PvmTransition transition = null;
try {
executeLogic(var);
if("a".equals(var)){
transition = execution.getActivity().findOutgoingTransition("a");
}else if("b".equals(var)){
transition = execution.getActivity().findOutgoingTransition("b");
}
else if("c".equals(var)){
transition = execution.getActivity().findOutgoingTransition("c");
}
else{
transition = execution.getActivity().findOutgoingTransition("no-exception");
}
} catch (Exception e) {
transition = execution.getActivity().findOutgoingTransition("exception");
}
execution.take(transition);
}

}

In activiti 6 PvmTransition is no more valid and execution.take(transition) api also not available.

What can be the possible solution that the same code will work for old version of processdefinition 5.16 and works in new version 6.x also.

Thanks and Regards,

Manoj Kumar

0 REPLIES 0