RemoteProcessRuntimeDataServiceImpl extends AbstractKieServerService implements ProcessRuntimeDataService { @Override public List<NodeInstanceSummary> getProcessInstanceActiveNodes(ProcessInstanceKey processInstanceKey) { if (processInstanceKey == null || processInstanceKey.isValid() == false) { return emptyList(); } QueryServicesClient queryServicesClient = getClient(processInstanceKey.getServerTemplateId(), QueryServicesClient.class); List<NodeInstance> nodeInstances = queryServicesClient.findActiveNodeInstances(processInstanceKey.getProcessInstanceId(), 0, Integer.MAX_VALUE); return nodeInstances.stream().map(new NodeInstanceSummaryMapper()).collect(toList()); }  @Override ProcessInstanceSummary getProcessInstance(ProcessInstanceKey processInstanceKey); @Override List<NodeInstanceSummary> getProcessInstanceActiveNodes(ProcessInstanceKey processInstanceKey); @Override List<NodeInstanceSummary> getProcessInstanceCompletedNodes(ProcessInstanceKey processInstanceKey); @Override ProcessInstanceDiagramSummary getProcessInstanceDiagramSummary(ProcessInstanceKey processInstanceKey, String completedNodeColor,
                                                                          String completedNodeBorderColor, String activeNodeBorderColor); @Override List<TimerInstanceSummary> getProcessInstanceTimerInstances(ProcessInstanceKey processInstanceKey); @Override void triggerProcessInstanceNode(ProcessInstanceKey processInstanceKey,
                                           Long nodeId); @Override void cancelProcessInstanceNode(ProcessInstanceKey processInstanceKey,
                                          Long nodeInstanceId); @Override void reTriggerProcessInstanceNode(ProcessInstanceKey processInstanceKey,
                                             Long nodeInstanceId); @Override void rescheduleTimerInstance(ProcessInstanceKey processInstanceKey,
                                        TimerInstanceSummary summary); @Override List<ProcessSummary> getProcesses(String serverTemplateId,
                                             Integer page,
                                             Integer pageSize,
                                             String sort,
                                             Boolean sortOrder); @Override ProcessSummary getProcess(final ProcessDefinitionKey processDefinitionKey); @Override List<ProcessSummary> getProcessesByFilter(String serverTemplateId,
                                                     String textSearch,
                                                     Integer page,
                                                     Integer pageSize,
                                                     String sort,
                                                     Boolean sortOrder); @Override List<TaskDefSummary> getProcessUserTasks(final String serverTemplateId,
                                                    final String containerId,
                                                    final String processId); @Override WorkItemSummary getWorkItemByProcessInstanceId(final String serverTemplateId,
                                                          final String containerId,
                                                          final Long processInstanceId,
                                                          final Long workItemId); @Override ProcessInstanceSummary getProcessInstanceByCorrelationKey(String serverTemplateId, String correlationKey); static int NOT_FOUND_ERROR_CODE; }
@Test public void testGetProcessInstanceActiveNodes() { ProcessInstanceKey instanceKey = new ProcessInstanceKey(serverTemplateId, containerId, processInstanceId); List<NodeInstance> nodeInstances = Arrays.asList(NodeInstance.builder().id(1l).name("name-1").nodeType("HumanTask").build(), NodeInstance.builder().id(2l).name(" ").nodeType("Split").build()); when(queryServicesClient.findActiveNodeInstances(instanceKey.getProcessInstanceId(), 0, Integer.MAX_VALUE)).thenReturn(nodeInstances); List<NodeInstanceSummary> nodes = service.getProcessInstanceActiveNodes(instanceKey); assertThat(nodes).hasSize(2).containsExactly(NodeInstanceSummary.builder().withId(1l).withName("name-1").withType("HumanTask").build(), NodeInstanceSummary.builder().withId(2l).withName(" ").withType("Split").build()); }