Search in sources :

Example 1 with CancelNodeInstanceCommand

use of org.jbpm.kie.services.impl.admin.commands.CancelNodeInstanceCommand in project jbpm by kiegroup.

the class ProcessInstanceAdminServiceImpl method cancelNodeInstance.

@Override
public void cancelNodeInstance(long processInstanceId, long nodeInstanceId) throws NodeInstanceNotFoundException, ProcessInstanceNotFoundException {
    ProcessInstanceDesc pi = runtimeDataService.getProcessInstanceById(processInstanceId);
    if (pi == null) {
        throw new ProcessInstanceNotFoundException("Process instance with id " + processInstanceId + " not found");
    }
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(processInstanceId), new CancelNodeInstanceCommand(processInstanceId, nodeInstanceId));
}
Also used : CancelNodeInstanceCommand(org.jbpm.kie.services.impl.admin.commands.CancelNodeInstanceCommand) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) ProcessInstanceNotFoundException(org.jbpm.services.api.ProcessInstanceNotFoundException)

Aggregations

CancelNodeInstanceCommand (org.jbpm.kie.services.impl.admin.commands.CancelNodeInstanceCommand)1 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)1 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)1