cancel
Showing results for 
Search instead for 
Did you mean: 

suspension not working

simply_sameer
Champ on-the-rise
Champ on-the-rise
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?
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
No, suspending the process instance which you are currently executing is not supported