@Test void testDoCancelProcessInstanceId() { mockProcessInstanceStatusActive().abort(); Object response = tested.doCancelProcessInstanceId(PROCESS_ID, PROCESS_INSTANCE_ID); verify(processInstance, times(0)).error(); verify(processInstance, times(1)).abort(); assertResultOk(response); }
public T doCancelProcessInstanceId(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { processInstance.abort(); if (processInstance.status() == ProcessInstance.STATE_ERROR) { throw new ProcessInstanceExecutionException(processInstance.id(), processInstance.error().get().failedNodeId(), processInstance.error().get().errorMessage()); } else { return buildOkResponse(processInstance.variables()); } }); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doCancelProcessInstanceId(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { processInstance.abort(); if (processInstance.status() == ProcessInstance.STATE_ERROR) { throw new ProcessInstanceExecutionException(processInstance.id(), processInstance.error().get().failedNodeId(), processInstance.error().get().errorMessage()); } else { return buildOkResponse(processInstance.variables()); } }); } }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doCancelProcessInstanceId(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { processInstance.abort(); if (processInstance.status() == ProcessInstance.STATE_ERROR) { throw new ProcessInstanceExecutionException(processInstance.id(), processInstance.error().get().failedNodeId(), processInstance.error().get().errorMessage()); } else { return buildOkResponse(processInstance.variables()); } }); } BaseProcessInstanceManagementResource(Processes processes, Application application); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doCancelProcessInstanceId(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { processInstance.abort(); if (processInstance.status() == ProcessInstance.STATE_ERROR) { throw new ProcessInstanceExecutionException(processInstance.id(), processInstance.error().get().failedNodeId(), processInstance.error().get().errorMessage()); } else { return buildOkResponse(processInstance.variables()); } }); } BaseProcessInstanceManagementResource(Processes processes, Application application); T doGetProcessNodes(String processId); T doGetInstanceInError(String processId, String processInstanceId); T doGetWorkItemsInProcessInstance(String processId, String processInstanceId); T doRetriggerInstanceInError(String processId, String processInstanceId); T doSkipInstanceInError(String processId, String processInstanceId); T doTriggerNodeInstanceId(String processId, String processInstanceId, String nodeId); T doRetriggerNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelProcessInstanceId(String processId, String processInstanceId); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doCancelProcessInstanceId(String processId, String processInstanceId) { return executeOnProcessInstance(processId, processInstanceId, processInstance -> { processInstance.abort(); if (processInstance.status() == ProcessInstance.STATE_ERROR) { throw new ProcessInstanceExecutionException(processInstance.id(), processInstance.error().get().failedNodeId(), processInstance.error().get().errorMessage()); } else { return buildOkResponse(processInstance.variables()); } }); } BaseProcessInstanceManagementResource(Processes processes, Application application); T doGetProcessNodes(String processId); T doGetInstanceInError(String processId, String processInstanceId); T doGetWorkItemsInProcessInstance(String processId, String processInstanceId); T doRetriggerInstanceInError(String processId, String processInstanceId); T doSkipInstanceInError(String processId, String processInstanceId); T doTriggerNodeInstanceId(String processId, String processInstanceId, String nodeId); T doRetriggerNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelNodeInstanceId(String processId, String processInstanceId, String nodeInstanceId); T doCancelProcessInstanceId(String processId, String processInstanceId);  }