AnsweredAssumed Answered

Suspend Functionality in Activiti

Question asked by chandanmb1 on Mar 29, 2016
Latest reply on Apr 4, 2016 by chandanmb1

First of all i need to understand how suspend action works in activiti.
Assume, i have a scenario

Start -> Service Task1 -> Service Task2 ->End
Service Task 1 - counts from 1 to 1000
Service Task 2 - counts from 1001 to 2000

I am trying to suspend after the execution of Service Task 1
   runtimeService = processEngine.getRuntimeService();
        processInstance = runtimeService.startProcessInstanceByKey("suspendDelUser");
        When process starts, Control directly goes to Service Task 1 and then to Service Task 2 and then Ends
        AFAIK, to suspend process,
        String ProcInstanceId = processInstance.getProcessInstanceId();
        which i am not getting.

How to suspend the process, when we are in the middle of execution of Service Task 1 (Or after completion of Service Task 1)
But it should not go to Service Task 2?