ProcessInstanceListPresenter extends AbstractMultiGridPresenter<ProcessInstanceSummary, ProcessInstanceListPresenter.ProcessInstanceListView> { protected String isFilteredByProcessId(ColumnFilter filter) { if (filter instanceof CoreFunctionFilter) { CoreFunctionFilter coreFilter = ((CoreFunctionFilter) filter); if (filter.getColumnId().toUpperCase().equals(COLUMN_PROCESS_ID.toUpperCase()) && ((CoreFunctionFilter) filter).getType() == CoreFunctionType.EQUALS_TO) { List parameters = coreFilter.getParameters(); if (parameters.size() > 0) { return parameters.get(0).toString(); } } } return null; }  @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 isFilteredByProcessIdTest() { final String processId = "testProc"; final DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(equalsTo(COLUMN_PROCESS_ID, processId)); final String filterProcessId = presenter.isFilteredByProcessId(Collections.<DataSetOp>singletonList(filter)); assertEquals(processId, filterProcessId); }
@Test public void isFilteredByProcessIdInvalidTest() { final String processId = "testProc"; final DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(likeTo(COLUMN_PROCESS_ID, processId)); final String filterProcessId = presenter.isFilteredByProcessId(Collections.<DataSetOp>singletonList(filter)); assertNull(filterProcessId); }