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?
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
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.