I would like to suspend an synchronous running process instance if I encounter some error to give admin some time to rectify the error and then he can resume the process instance using its id.
I am trying to suspend a running process instance from java delegate class but it does not seem to suspend.
Below is my code -
public class Generate_DT_PS_CCS implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
String pid =execution.getProcessInstanceId();
System.out.println("supending the instance - process id " +pid);
runtimeService.suspendProcessInstanceById(execution.getProcessInstanceId());
}
}
Is there any issue in suspend the synchronous service task in Camunda?