AnsweredAssumed Answered

suspension not working

Question asked by simply_sameer on Jul 26, 2015
Latest reply on Jul 28, 2015 by jbarrez
Hi,

I want to suspension on a given condition and then restart after some event is generated. I'm calling below suspension in activiti1 (Please look into attachment for complete flow)

   execution.getEngineServices().getRuntimeService().suspendProcessInstanceById(execution.getProcessInstanceId());


But it's still calling next service. I want suspend flow as soon as suspend method is called.


public class Activity1 implements JavaDelegate{
   @Override
   public void execute(DelegateExecution execution) throws Exception {
      System.out.println(execution.getProcessInstanceId());
      execution.getEngineServices().getRuntimeService().suspendProcessInstanceById(execution.getProcessInstanceId());
      System.out.println("Activity 1");
   }
}

public class Activity2 implements JavaDelegate{
   @Override
   public void execute(DelegateExecution execution) throws Exception {
      System.out.println("Activity2");      
   }
}
public class Activity3 implements JavaDelegate{
   @Override
   public void execute(DelegateExecution execution) throws Exception {
      System.out.println("Activity3");      
   }
}


Output :-
8
Activity 1
Activity2
Activity3

Questions:- 1) Why flow is not suspending?
                    2) Each time I deploy my application (first process ID is always 8). Why this is so.

Please Help?

Attachments

Outcomes