01-09-2019 08:25 AM
Hi all.
I am writing a service to work with an instance of the process. It has methods for creating a process, completing a user task, etc. Now I got to the method of destroying / stopping the process instance.I wrote such the method:
@Override
public void terminateProcessInstance(String processInstanceId) throws ActivitiServiceException {
try {
runtimeService.deleteProcessInstance(processInstanceId, "deleted by User");
} catch (ActivitiObjectNotFoundException e) {
e.printStackTrace();
final String message = "There is no process instance with id = " + processInstanceId;
logger.error(message, e);
throw new ActivitiServiceException(message, e);
} catch (Exception e) {
e.printStackTrace();
final String message = "There was an exception while terminating the process instance with id = " + processInstanceId + ": ";
logger.error(message, e);
throw new ActivitiServiceException(message, e);
}
}
And it does not work for me if the timer is running. There is an optimistic lock (in the Activiti engine).
How do I kill a process if the timer is running?
02-19-2021 04:47 AM
Hi maxlich,
Did you find any solution for this ? Something to "clear" the timers before deletion?
As we are encoutering the exact same problem here, this would be of a great help!
Have a good day,
Victor
Explore our Alfresco products with the links below. Use labels to filter content by product module.