@Test void testDoGetInstanceInError() { Object response = tested.doGetInstanceInError(PROCESS_ID, PROCESS_INSTANCE_ID); verify(processInstance, times(2)).error(); verify(error, times(0)).retrigger(); verify(error, times(0)).skip(); verify(tested).buildOkResponse(any()); assertThat(response).isInstanceOf(Map.class); Map responseMap = (Map) response; assertThat(responseMap.get("id")).isEqualTo(PROCESS_INSTANCE_ID); assertThat(responseMap.get("failedNodeId")).isEqualTo(NODE_ID_ERROR); }
public T doGetInstanceInError(String processId, String processInstanceId) { return executeOnInstanceInError(processId, processInstanceId, processInstance -> { ProcessError error = processInstance.error().get(); Map<String, String> data = new HashMap<>(); data.put("id", processInstance.id()); data.put("failedNodeId", error.failedNodeId()); data.put("message", error.errorMessage()); return buildOkResponse(data); }); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetInstanceInError(String processId, String processInstanceId) { return executeOnInstanceInError(processId, processInstanceId, processInstance -> { ProcessError error = processInstance.error().get(); Map<String, String> data = new HashMap<>(); data.put("id", processInstance.id()); data.put("failedNodeId", error.failedNodeId()); data.put("message", error.errorMessage()); return buildOkResponse(data); }); } }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetInstanceInError(String processId, String processInstanceId) { return executeOnInstanceInError(processId, processInstanceId, processInstance -> { ProcessError error = processInstance.error().get(); Map<String, String> data = new HashMap<>(); data.put("id", processInstance.id()); data.put("failedNodeId", error.failedNodeId()); data.put("message", error.errorMessage()); return buildOkResponse(data); }); } BaseProcessInstanceManagementResource(Processes processes, Application application); }
BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetInstanceInError(String processId, String processInstanceId) { return executeOnInstanceInError(processId, processInstanceId, processInstance -> { ProcessError error = processInstance.error().get(); Map<String, String> data = new HashMap<>(); data.put("id", processInstance.id()); data.put("failedNodeId", error.failedNodeId()); data.put("message", error.errorMessage()); return buildOkResponse(data); }); } 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 doGetInstanceInError(String processId, String processInstanceId) { return executeOnInstanceInError(processId, processInstanceId, processInstance -> { ProcessError error = processInstance.error().get(); Map<String, String> data = new HashMap<>(); data.put("id", processInstance.id()); data.put("failedNodeId", error.failedNodeId()); data.put("message", error.errorMessage()); return buildOkResponse(data); }); } 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);  }