Source:
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception { ProcessDefinitionDataSetDef processDefinitionDataSetDef = (ProcessDefinitionDataSetDef) def; final DataSetBuilder dsBuilder = DataSetFactory.newDataSetBuilder(); for (final DataColumnDef columnDef : processDefinitionDataSetDef.getColumns()) { dsBuilder.column(columnDef.getId(), columnDef.getColumnType()); } ConsoleDataSetLookup consoleDataSetLookup = (ConsoleDataSetLookup)lookup; processDefinitionDataSetDef.setServerTemplateId(consoleDataSetLookup.getServerTemplateId()); if (consoleDataSetLookup.getServerTemplateId() == null || consoleDataSetLookup.getServerTemplateId().isEmpty()) { return buildDataSet(def, new ArrayList<>(), new ArrayList<>()); } String defaultColumnSort = COL_ID_PROCESSNAME; boolean defaultSortOrder = false; DataSetSort dataSetSort = lookup.getFirstSortOp(); if (dataSetSort != null && dataSetSort.getColumnSortList().size() > 0) { defaultColumnSort = dataSetSort.getColumnSortList().get(0).toString(); defaultSortOrder = dataSetSort.getColumnSortList().get(0).getOrder().equals(SortOrder.ASCENDING); } final StringBuffer searchText = new StringBuffer(); for (DataSetFilter filter : lookup.getOperationList(DataSetFilter.class)) { filter.getColumnFilterList().forEach(columnFilter -> { if (columnFilter instanceof CoreFunctionFilter) { CoreFunctionFilter coreFunctionFilter = (CoreFunctionFilter) columnFilter; if (coreFunctionFilter.getParameters().size() > 0) { searchText.append(coreFunctionFilter.getParameters().get(0)); } } }); } List<ProcessSummary> processSummaryList = processRuntimeDataService.getProcessesByFilter(consoleDataSetLookup.getServerTemplateId(), searchText.toString(), lookup.getRowOffset() / lookup.getNumberOfRows(), lookup.getNumberOfRows(), defaultColumnSort, defaultSortOrder); processSummaryList.forEach( processSummary -> { dsBuilder.row(processSummary.getProcessDefName(), processSummary.getVersion(), processSummary.getDeploymentId(), processSummary.getProcessDefId(), processSummary.isDynamic()); } ); DataSet dataSet = dsBuilder.buildDataSet(); dataSet.setUUID(PROCESS_DEFINITION_DATASET); return dataSet; }

Target:
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception { ProcessDefinitionDataSetDef processDefinitionDataSetDef = (ProcessDefinitionDataSetDef) def; final DataSetBuilder dsBuilder = DataSetFactory.newDataSetBuilder(); for (final DataColumnDef columnDef : processDefinitionDataSetDef.getColumns()) { dsBuilder.column(columnDef.getId(), columnDef.getColumnType()); } ConsoleDataSetLookup consoleDataSetLookup = (ConsoleDataSetLookup) lookup; processDefinitionDataSetDef.setServerTemplateId(consoleDataSetLookup.getServerTemplateId()); String defaultColumnSort = COL_ID_PROCESSNAME; boolean defaultSortOrder = false; DataSetSort dataSetSort = lookup.getFirstSortOp(); if (dataSetSort != null && dataSetSort.getColumnSortList().size() > 0) { defaultColumnSort = dataSetSort.getColumnSortList().get(0).getColumnId(); defaultSortOrder = dataSetSort.getColumnSortList().get(0).getOrder().equals(SortOrder.ASCENDING); } String searchText = ""; for (DataSetFilter filter : lookup.getOperationList(DataSetFilter.class)) { Optional coreFunctionFilter = filter.getColumnFilterList().stream() .filter(columnFilter -> columnFilter instanceof CoreFunctionFilter) .filter(columnFilter -> ((CoreFunctionFilter) columnFilter).getParameters().size() > 0).findFirst(); if (coreFunctionFilter.isPresent()) { searchText = ((CoreFunctionFilter) coreFunctionFilter.get()).getParameters().get(0).toString(); } } List<ProcessSummary> processSummaryList = processRuntimeDataService.getProcessesByFilter(consoleDataSetLookup.getServerTemplateId(), searchText, lookup.getRowOffset() / lookup.getNumberOfRows(), lookup.getNumberOfRows(), defaultColumnSort, defaultSortOrder); processSummaryList.forEach(processSummary -> dsBuilder.row(processSummary.getProcessDefName(), processSummary.getVersion(), processSummary.getDeploymentId(), processSummary.getProcessDefId(), processSummary.isDynamic()) ); DataSet dataSet = dsBuilder.buildDataSet(); dataSet.setUUID(PROCESS_DEFINITION_DATASET); return dataSet; }