ProcessInstanceListPresenter extends AbstractMultiGridPresenter<ProcessInstanceSummary, ProcessInstanceListPresenter.ProcessInstanceListView> { protected ProcessInstanceSummary createProcessInstanceSummaryFromDataSet(DataSet dataSet, int i) { return new ProcessInstanceSummary( getSelectedServerTemplate(), getColumnLongValue(dataSet, COLUMN_PROCESS_INSTANCE_ID, i), getColumnStringValue(dataSet, COLUMN_PROCESS_ID, i), getColumnStringValue(dataSet, COLUMN_EXTERNAL_ID, i), getColumnStringValue(dataSet, COLUMN_PROCESS_NAME, i), getColumnStringValue(dataSet, COLUMN_PROCESS_VERSION, i), getColumnIntValue(dataSet, COLUMN_STATUS, i), getColumnDateValue(dataSet, COLUMN_START, i), getColumnDateValue(dataSet, COLUMN_END, i), getColumnStringValue(dataSet, COLUMN_IDENTITY, i), getColumnStringValue(dataSet, COLUMN_PROCESS_INSTANCE_DESCRIPTION, i), getColumnStringValue(dataSet, COLUMN_CORRELATION_KEY, i), getColumnLongValue(dataSet, COLUMN_PARENT_PROCESS_INSTANCE_ID, i), getColumnDateValue(dataSet, COLUMN_LAST_MODIFICATION_DATE, i), getColumnIntValue(dataSet, COLUMN_SLA_COMPLIANCE, i), getColumnDateValue(dataSet, COLUMN_SLA_DUE_DATE, i), getColumnIntValue(dataSet, COLUMN_ERROR_COUNT, i) ); }  @Inject void setProcessInstanceSelectedEvent(final Event<ProcessInstanceSelectionEvent> processInstanceSelectionEvent); @Override void createListBreadcrumb(); void setupDetailBreadcrumb(String detailLabel); void getDomainSpecifDataForProcessInstances(final Integer startRange,
                                                       final List<ProcessInstanceSummary> instancesFromDataSet,
                                                       final Boolean lastPage); void newInstanceCreated(@Observes final NewProcessInstanceEvent pi); void newInstanceCreated(@Observes final ProcessInstancesUpdateEvent pis); void abortProcessInstance(String containerId,
                                     long processInstanceId); void abortProcessInstances(Map<String, List<Long>> containerInstances); void bulkSignal(List<ProcessInstanceSummary> processInstances); void bulkAbort(List<ProcessInstanceSummary> processInstances); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); void signalProcessInstance(final ProcessInstanceSummary processInstance); @Override void selectSummaryItem(final ProcessInstanceSummary summary); void refreshDetailBreadcrumb(@Observes ProcessInstanceSelectionEvent event); void formClosed(@Observes BeforeClosePlaceEvent closed); @Inject void setFilterSettingsManager(final ProcessInstanceListFilterSettingsManager filterSettingsManager); @Inject void setProcessService(final Caller<ProcessService> processService); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); void openJobsView(final String pid); void openTaskView(final String pid); @Override void openErrorView(final String pid); Predicate<ProcessInstanceSummary> getSignalActionCondition(); Predicate<ProcessInstanceSummary> getAbortActionCondition(); Predicate<ProcessInstanceSummary> getViewJobsActionCondition(); Predicate<ProcessInstanceSummary> getViewTasksActionCondition(); @Override Predicate<ProcessInstanceSummary> getViewErrorsActionCondition();  }
@Test public void testDataSetQueryHelperColumnMapping() { final Long TEST_PROC_INST_ID = Long.valueOf(55); final String TEST_PROC_ID = "TEST_PROC_ID"; final String TEST_EXT_ID = "TEST_EXT_ID"; final String TEST_PROC_NAME = "TEST_PROC_NAME"; final String TEST_PROC_VER = "TEST_PROC_VER"; final Integer TEST_STATE = 7; final Date TEST_START_DATE = new Date(new Date().getTime() - (2 * 60 * 60 * 1000)); final Date TEST_END_DATE = new Date(new Date().getTime() + (2 * 60 * 60 * 1000)); final String TEST_IDENTITY = "TEST_IDENTITY"; final String TEST_INST_DESC = "TEST_INST_DESC"; final String TEST_CORREL_KEY = "TEST_CORREL_KEY"; final Long TEST_PARENT_PROC_INST_ID = Long.valueOf(66); final Date TEST_LAST_MODIF_DATE = new Date(); final Integer TEST_ERROR_COUNT = 66; when(dataSetProcessVar.getValueAt(0, COLUMN_PROCESS_INSTANCE_ID)).thenReturn(TEST_PROC_INST_ID); when(dataSetProcessVar.getValueAt(0, COLUMN_PROCESS_ID)).thenReturn(TEST_PROC_ID); when(dataSetProcessVar.getValueAt(0, COLUMN_EXTERNAL_ID)).thenReturn(TEST_EXT_ID); when(dataSetProcessVar.getValueAt(0, COLUMN_PROCESS_NAME)).thenReturn(TEST_PROC_NAME); when(dataSetProcessVar.getValueAt(0, COLUMN_PROCESS_VERSION)).thenReturn(TEST_PROC_VER); when(dataSetProcessVar.getValueAt(0, COLUMN_STATUS)).thenReturn(TEST_STATE); when(dataSetProcessVar.getValueAt(0, COLUMN_START)).thenReturn(TEST_START_DATE); when(dataSetProcessVar.getValueAt(0, COLUMN_END)).thenReturn(TEST_END_DATE); when(dataSetProcessVar.getValueAt(0, COLUMN_IDENTITY)).thenReturn(TEST_IDENTITY); when(dataSetProcessVar.getValueAt(0, COLUMN_PROCESS_INSTANCE_DESCRIPTION)).thenReturn(TEST_INST_DESC); when(dataSetProcessVar.getValueAt(0, COLUMN_CORRELATION_KEY)).thenReturn(TEST_CORREL_KEY); when(dataSetProcessVar.getValueAt(0, COLUMN_PARENT_PROCESS_INSTANCE_ID)).thenReturn(TEST_PARENT_PROC_INST_ID); when(dataSetProcessVar.getValueAt(0, COLUMN_LAST_MODIFICATION_DATE)).thenReturn(TEST_LAST_MODIF_DATE); when(dataSetProcessVar.getValueAt(0, COLUMN_ERROR_COUNT)).thenReturn(TEST_ERROR_COUNT); ProcessInstanceSummary pis = presenter.createProcessInstanceSummaryFromDataSet(dataSetProcessVar, 0); assertEquals(TEST_PROC_INST_ID, pis.getProcessInstanceId()); assertEquals(TEST_PROC_ID, pis.getProcessId()); assertEquals(TEST_EXT_ID, pis.getDeploymentId()); assertEquals(TEST_PROC_NAME, pis.getProcessName()); assertEquals(TEST_PROC_VER, pis.getProcessVersion()); assertEquals(TEST_STATE, pis.getState()); assertEquals(TEST_START_DATE, pis.getStartTime()); assertEquals(TEST_END_DATE, pis.getEndTime()); assertEquals(TEST_IDENTITY, pis.getInitiator()); assertEquals(TEST_INST_DESC, pis.getProcessInstanceDescription()); assertEquals(TEST_CORREL_KEY, pis.getCorrelationKey()); assertEquals(TEST_PARENT_PROC_INST_ID, pis.getParentId()); assertEquals(TEST_LAST_MODIF_DATE, pis.getLastModificationDate()); assertEquals(TEST_ERROR_COUNT, pis.getErrorCount()); }