BaseProcessInstanceManagementResource implements ProcessInstanceManagement<T> { public T doGetProcessNodes(String processId) { return executeOnProcess(processId, process -> { List<Node> nodes = ((WorkflowProcess) ((AbstractProcess<?>) process).process()).getNodesRecursively(); List<Map<String, Object>> list = nodes.stream().map(n -> { Map<String, Object> data = new HashMap<>(); data.put("id", n.getId()); data.put("uniqueId", ((org.jbpm.workflow.core.Node) n).getUniqueId()); data.put("nodeDefinitionId", n.getMetaData().get(UNIQUE_ID)); data.put("type", n.getClass().getSimpleName()); data.put("name", n.getName()); return data; }).collect(Collectors.toList()); return buildOkResponse(list); }); } 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);  }
@Test void testDoGetProcessNodes() { Object response = tested.doGetProcessNodes(PROCESS_ID); verify(processes).processById(PROCESS_ID); verify(process).process(); verify(wp).getNodesRecursively(); assertThat(response).isInstanceOf(List.class).asList().hasSize(1).element(0) .hasFieldOrPropertyWithValue("id", node.getId()) .hasFieldOrPropertyWithValue("name", node.getName()) .hasFieldOrPropertyWithValue("uniqueId", node.getUniqueId()) .hasFieldOrPropertyWithValue("nodeDefinitionId", NODE_UNIQUE_ID) .hasFieldOrPropertyWithValue("type", node.getClass().getSimpleName()); }