How to get next task in task complete listener

I want notificate next user by sms after current activity task completed.But I dont know how get get next task.
Thanks for you help.


When the current user task is completed you can do a TaskQuery with the TaskService to get the next Task. Or do you need this logic inside the process instance? Then you could use a TaskListener with a create event for example (, and send the SMS as part of the TaskListener logic.

Best regards,


Hi tijs,
I was finish this work with the method.

ExpressionManager expressionManager = springProcessEngineConfiguration.getExpressionManager(); 
for (SequenceFlow flow : outgoingFlows) {
   String expression = flow.getConditionExpression(); 
   if (expression == null || expression.trim().equals("")) { 
      return flow.getTargetFlowElement();
   VariableContainerWrapper variable = new VariableContainerWrapper(processVariables);
   Object value = expressionManager.createExpression(expression).getValue(variable);
   if (value instanceof Boolean) {
       if ((Boolean) value) {
         return flow.getTargetFlowElement();
       } else { 
         throw new FlowableIllegalArgumentException("expression error");