RemoteProcessRuntimeDataServiceImpl extends AbstractKieServerService implements ProcessRuntimeDataService { @Override public List<TimerInstanceSummary> getProcessInstanceTimerInstances(ProcessInstanceKey processInstanceKey) { if (processInstanceKey == null || processInstanceKey.isValid() == false) { return emptyList(); } ProcessAdminServicesClient servicesClient = getClient(processInstanceKey.getServerTemplateId(), ProcessAdminServicesClient.class); return servicesClient.getTimerInstances(processInstanceKey.getDeploymentId(), processInstanceKey.getProcessInstanceId()).stream().map(new TimerInstanceSummaryMapper()).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 testGetProcessInstanceTimerInstances() { ProcessInstanceKey instanceKey = new ProcessInstanceKey(serverTemplateId, containerId, processInstanceId); List<TimerInstance> timerInstances = Arrays.asList(TimerInstance.builder().id(1l).timerId(0l).timerName("timer1").period(2l).delay(1).build(), TimerInstance.builder().id(2l).timerId(1l).timerName("time2").period(1l).delay(2).build()); when(processAdminServicesClient.getTimerInstances(containerId, processInstanceId)).thenReturn(timerInstances); List<TimerInstanceSummary> timers = service.getProcessInstanceTimerInstances(instanceKey); assertThat(timers).hasSize(2).containsExactly(TimerInstanceSummary.builder().withId(1l).withTimerId(0l).withName("timer1").withPeriod(2l).withDelay(1l).build(), TimerInstanceSummary.builder().withId(2l).withTimerId(1l).withName("time2").withPeriod(1l).withDelay(2l).build()); }