@Test public void setProcessInstanceDetailsTestWihtoutParentProcessInstance() { when(processRuntimeDataServiceMock.getProcessInstance(any())).thenReturn(null); presenter.setProcessInstance(processInstanceSummary); verify(view).setParentProcessInstanceIdText("", false); verify(view).setParentProcessInstanceIdText("1", false); }
@Override public void setProcessInstance(ProcessInstanceSummary process) { view.setProcessDefinitionIdText(""); view.setProcessVersionText(""); view.setProcessDeploymentText(""); view.setCorrelationKeyText(""); view.setActiveTasksListBox(""); view.setStateText(""); view.setCurrentActivitiesListBox(""); view.setParentProcessInstanceIdText("", false); view.setProcessDefinitionIdText(process.getProcessId()); view.setProcessVersionText(process.getProcessVersion()); view.setProcessDeploymentText(process.getDeploymentId()); view.setCorrelationKeyText(process.getCorrelationKey()); if (process.getParentId() > 0) { setParentInstance(process); } else { view.setParentProcessInstanceIdText(constants.No_Parent_Process_Instance(), false); } view.setSlaComplianceText(new SlaStatusConverter().toWidgetValue(process.getSlaCompliance())); view.setStateText(ProcessInstanceStatusUtils.toWidgetValue(process.getState())); if (process.getActiveTasks() != null && !process.getActiveTasks().isEmpty()) { SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (UserTaskSummary uts : process.getActiveTasks()) { safeHtmlBuilder.appendEscapedLines(uts.getName() + " (" + uts.getStatus() + ") " + constants.Owner() + ": " + uts.getOwner() + " \n"); } view.setActiveTasksListBox(safeHtmlBuilder.toSafeHtml().asString()); } processRuntimeDataService.call( (final List<NodeInstanceSummary> details) -> { final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (NodeInstanceSummary nis : details) { safeHtmlBuilder.appendEscapedLines(nis.getTimestamp() + ": " + nis.getId() + " - " + nis.getName() + " (" + nis.getType() + ") \n"); } view.setCurrentActivitiesListBox(safeHtmlBuilder.toSafeHtml().asString()); } ).getProcessInstanceActiveNodes(process.getProcessInstanceKey()); }
ProcessInstanceDetailsTabPresenter implements ProcessInstanceSummaryAware { @Override public void setProcessInstance(ProcessInstanceSummary process) { view.setProcessDefinitionIdText(""); view.setProcessVersionText(""); view.setProcessDeploymentText(""); view.setCorrelationKeyText(""); view.setActiveTasksListBox(""); view.setStateText(""); view.setCurrentActivitiesListBox(""); view.setParentProcessInstanceIdText("", false); view.setProcessDefinitionIdText(process.getProcessId()); view.setProcessVersionText(process.getProcessVersion()); view.setProcessDeploymentText(process.getDeploymentId()); view.setCorrelationKeyText(process.getCorrelationKey()); if (process.getParentId() > 0) { setParentInstance(process); } else { view.setParentProcessInstanceIdText(constants.No_Parent_Process_Instance(), false); } view.setSlaComplianceText(new SlaStatusConverter().toWidgetValue(process.getSlaCompliance())); view.setStateText(ProcessInstanceStatusUtils.toWidgetValue(process.getState())); if (process.getActiveTasks() != null && !process.getActiveTasks().isEmpty()) { SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (UserTaskSummary uts : process.getActiveTasks()) { safeHtmlBuilder.appendEscapedLines(uts.getName() + " (" + uts.getStatus() + ") " + constants.Owner() + ": " + uts.getOwner() + " \n"); } view.setActiveTasksListBox(safeHtmlBuilder.toSafeHtml().asString()); } processRuntimeDataService.call( (final List<NodeInstanceSummary> details) -> { final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (NodeInstanceSummary nis : details) { safeHtmlBuilder.appendEscapedLines(nis.getTimestamp() + ": " + nis.getId() + " - " + nis.getName() + " (" + nis.getType() + ") \n"); } view.setCurrentActivitiesListBox(safeHtmlBuilder.toSafeHtml().asString()); } ).getProcessInstanceActiveNodes(process.getProcessInstanceKey()); } }
ProcessInstanceDetailsTabPresenter implements ProcessInstanceSummaryAware { @Override public void setProcessInstance(ProcessInstanceSummary process) { view.setProcessDefinitionIdText(""); view.setProcessVersionText(""); view.setProcessDeploymentText(""); view.setCorrelationKeyText(""); view.setActiveTasksListBox(""); view.setStateText(""); view.setCurrentActivitiesListBox(""); view.setParentProcessInstanceIdText("", false); view.setProcessDefinitionIdText(process.getProcessId()); view.setProcessVersionText(process.getProcessVersion()); view.setProcessDeploymentText(process.getDeploymentId()); view.setCorrelationKeyText(process.getCorrelationKey()); if (process.getParentId() > 0) { setParentInstance(process); } else { view.setParentProcessInstanceIdText(constants.No_Parent_Process_Instance(), false); } view.setSlaComplianceText(new SlaStatusConverter().toWidgetValue(process.getSlaCompliance())); view.setStateText(ProcessInstanceStatusUtils.toWidgetValue(process.getState())); if (process.getActiveTasks() != null && !process.getActiveTasks().isEmpty()) { SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (UserTaskSummary uts : process.getActiveTasks()) { safeHtmlBuilder.appendEscapedLines(uts.getName() + " (" + uts.getStatus() + ") " + constants.Owner() + ": " + uts.getOwner() + " \n"); } view.setActiveTasksListBox(safeHtmlBuilder.toSafeHtml().asString()); } processRuntimeDataService.call( (final List<NodeInstanceSummary> details) -> { final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (NodeInstanceSummary nis : details) { safeHtmlBuilder.appendEscapedLines(nis.getTimestamp() + ": " + nis.getId() + " - " + nis.getName() + " (" + nis.getType() + ") \n"); } view.setCurrentActivitiesListBox(safeHtmlBuilder.toSafeHtml().asString()); } ).getProcessInstanceActiveNodes(process.getProcessInstanceKey()); }  }
ProcessInstanceDetailsTabPresenter implements ProcessInstanceSummaryAware { @Override public void setProcessInstance(ProcessInstanceSummary process) { view.setProcessDefinitionIdText(""); view.setProcessVersionText(""); view.setProcessDeploymentText(""); view.setCorrelationKeyText(""); view.setActiveTasksListBox(""); view.setStateText(""); view.setCurrentActivitiesListBox(""); view.setParentProcessInstanceIdText("", false); view.setProcessDefinitionIdText(process.getProcessId()); view.setProcessVersionText(process.getProcessVersion()); view.setProcessDeploymentText(process.getDeploymentId()); view.setCorrelationKeyText(process.getCorrelationKey()); if (process.getParentId() > 0) { setParentInstance(process); } else { view.setParentProcessInstanceIdText(constants.No_Parent_Process_Instance(), false); } view.setSlaComplianceText(new SlaStatusConverter().toWidgetValue(process.getSlaCompliance())); view.setStateText(ProcessInstanceStatusUtils.toWidgetValue(process.getState())); if (process.getActiveTasks() != null && !process.getActiveTasks().isEmpty()) { SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (UserTaskSummary uts : process.getActiveTasks()) { safeHtmlBuilder.appendEscapedLines(uts.getName() + " (" + uts.getStatus() + ") " + constants.Owner() + ": " + uts.getOwner() + " \n"); } view.setActiveTasksListBox(safeHtmlBuilder.toSafeHtml().asString()); } processRuntimeDataService.call( (final List<NodeInstanceSummary> details) -> { final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (NodeInstanceSummary nis : details) { safeHtmlBuilder.appendEscapedLines(nis.getTimestamp() + ": " + nis.getId() + " - " + nis.getName() + " (" + nis.getType() + ") \n"); } view.setCurrentActivitiesListBox(safeHtmlBuilder.toSafeHtml().asString()); } ).getProcessInstanceActiveNodes(process.getProcessInstanceKey()); }  @Inject void setView(final ProcessInstanceDetailsTabView view); @Inject void setProcessRuntimeDataService(final Caller<ProcessRuntimeDataService> processRuntimeDataService); @Inject void setProcessInstanceSelectionEvent(final Event<ProcessInstanceSelectionEvent> processInstanceSelectionEvent); IsWidget getWidget(); @Override void setProcessInstance(ProcessInstanceSummary process); void onProcessInstanceIdSelected(String serverTemplateId, String processDeploymentId, Long parentId); }
ProcessInstanceDetailsTabPresenter implements ProcessInstanceSummaryAware { @Override public void setProcessInstance(ProcessInstanceSummary process) { view.setProcessDefinitionIdText(""); view.setProcessVersionText(""); view.setProcessDeploymentText(""); view.setCorrelationKeyText(""); view.setActiveTasksListBox(""); view.setStateText(""); view.setCurrentActivitiesListBox(""); view.setParentProcessInstanceIdText("", false); view.setProcessDefinitionIdText(process.getProcessId()); view.setProcessVersionText(process.getProcessVersion()); view.setProcessDeploymentText(process.getDeploymentId()); view.setCorrelationKeyText(process.getCorrelationKey()); if (process.getParentId() > 0) { setParentInstance(process); } else { view.setParentProcessInstanceIdText(constants.No_Parent_Process_Instance(), false); } view.setSlaComplianceText(new SlaStatusConverter().toWidgetValue(process.getSlaCompliance())); view.setStateText(ProcessInstanceStatusUtils.toWidgetValue(process.getState())); if (process.getActiveTasks() != null && !process.getActiveTasks().isEmpty()) { SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (UserTaskSummary uts : process.getActiveTasks()) { safeHtmlBuilder.appendEscapedLines(uts.getName() + " (" + uts.getStatus() + ") " + constants.Owner() + ": " + uts.getOwner() + " \n"); } view.setActiveTasksListBox(safeHtmlBuilder.toSafeHtml().asString()); } processRuntimeDataService.call( (final List<NodeInstanceSummary> details) -> { final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); for (NodeInstanceSummary nis : details) { safeHtmlBuilder.appendEscapedLines(nis.getTimestamp() + ": " + nis.getId() + " - " + nis.getName() + " (" + nis.getType() + ") \n"); } view.setCurrentActivitiesListBox(safeHtmlBuilder.toSafeHtml().asString()); } ).getProcessInstanceActiveNodes(process.getProcessInstanceKey()); }  @Inject void setView(final ProcessInstanceDetailsTabView view); @Inject void setProcessRuntimeDataService(final Caller<ProcessRuntimeDataService> processRuntimeDataService); @Inject void setProcessInstanceSelectionEvent(final Event<ProcessInstanceSelectionEvent> processInstanceSelectionEvent); IsWidget getWidget(); @Override void setProcessInstance(ProcessInstanceSummary process); void onProcessInstanceIdSelected(String serverTemplateId, String processDeploymentId, Long parentId);  }