ProcessInstanceLogPresenter extends AbstractMultiGridPresenter<ProcessInstanceLogSummary, ProcessInstanceLogPresenter.ProcessInstanceLogView> implements ProcessInstanceSummaryAware { public void setupActiveSearchFilters() { processInstanceLogBasicFiltersPresenter.onClearAllActiveFiltersEvent(new ClearAllActiveFiltersEvent()); final List<String> types = Arrays.asList(LogUtils.NODE_TYPE_START, LogUtils.NODE_TYPE_END, LogUtils.NODE_TYPE_HUMAN_TASK, LogUtils.NODE_TYPE_ACTION, LogUtils.NODE_TYPE_MILESTONE, LogUtils.NODE_TYPE_SUBPROCESS, LogUtils.NODE_TYPE_RULE_SET, LogUtils.NODE_TYPE_WORK_ITEM); final List<String> nodeTypeLabels = Arrays.asList(constants.StartNodes(), constants.EndNodes(), constants.Human_Tasks(), constants.ActionNodes(), constants.Milestones(), constants.SubProcesses(), constants.RuleSets(), constants.WorkItems()); addActiveFilter(in(COLUMN_LOG_NODE_TYPE, types), constants.EventNodeType(), String.join(", ", nodeTypeLabels), types, v -> removeActiveFilter(in(COLUMN_LOG_NODE_TYPE, types)) ); addActiveFilter(in(COLUMN_LOG_TYPE, Collections.emptyList()), constants.EventType(), "", Collections.emptyList(), v -> removeActiveFilter(in(COLUMN_LOG_TYPE, Collections.emptyList()))); }  int getPageSize(); void setCurrentPage(int i); int getCurrentPage(); @Inject void setDataSetQueryHelper(final DataSetQueryHelper dataSetQueryHelper); @Inject void setProcessInstanceLogBasicFiltersPresenter(final ProcessInstanceLogBasicFiltersPresenter pILBasicFiltersPresenter); @Inject void setFilterSettingsManager(final ProcessInstanceLogFilterSettingsManager filterSettingsManager); @PostConstruct void init(); IsWidget getWidget(); HTMLElement getBasicFiltersView(); DataSetQueryHelper getDataSetQueryHelper(); void loadProcessInstanceLogs(); void loadMoreProcessInstanceLogs(); void loadTaskDetails(Long workItemId,
                                final Date logDate,
                                ProcessInstanceLogItemDetailsView workItemView); void loadWorkItemDetails(Long workItemId,
                                    ProcessInstanceLogItemDetailsView workItemView); @Override void setProcessInstance(ProcessInstanceSummary processInstance); void refreshGrid(); @Override boolean existActiveSearchFilters(); void setupActiveSearchFilters(); @Override void createListBreadcrumb(); @Inject void setTaskService(Caller<TaskService> taskService); @Inject void setProcessRuntimeDataService(Caller<ProcessRuntimeDataService> processRuntimeDataService); static final int PAGE_SIZE; }
@Test public void testDefaultActiveSearchFilters() { presenter.setupActiveSearchFilters(); ArgumentCaptor<ActiveFilterItem> captor = ArgumentCaptor.forClass(ActiveFilterItem.class); verify(view, times(2)).addActiveFilter(captor.capture()); final ActiveFilterItem nodeTypefilterItem = captor.getAllValues().get(0); assertNotNull(nodeTypefilterItem); assertEquals(Constants.INSTANCE.EventNodeType(), nodeTypefilterItem.getKey()); List values = (List) nodeTypefilterItem.getValue(); assertEquals(8, values.size()); assertEquals(LogUtils.NODE_TYPE_START, values.get(0)); assertEquals(LogUtils.NODE_TYPE_END, values.get(1)); assertEquals(LogUtils.NODE_TYPE_HUMAN_TASK, values.get(2)); assertEquals(LogUtils.NODE_TYPE_ACTION, values.get(3)); assertEquals(LogUtils.NODE_TYPE_MILESTONE, values.get(4)); assertEquals(LogUtils.NODE_TYPE_SUBPROCESS, values.get(5)); assertEquals(LogUtils.NODE_TYPE_RULE_SET, values.get(6)); assertEquals(LogUtils.NODE_TYPE_WORK_ITEM, values.get(7)); final ActiveFilterItem typeFilterItem = captor.getAllValues().get(1); assertNotNull(typeFilterItem); assertEquals(Constants.INSTANCE.EventType(), typeFilterItem.getKey()); assertEquals(emptyList(), typeFilterItem.getValue()); }