Source:
<code>public PagedModel<TaskDefinitionResource> list(Pageable pageable, @RequestParam(required = false) String search, @RequestParam(required = false) boolean manifest, @RequestParam(required = false) String dslText, PagedResourcesAssembler<TaskExecutionAwareTaskDefinition> assembler) { final Page<TaskDefinition> taskDefinitions; if (search != null) { if (dslText != null) { <START> taskDefinitions = repository.findByTaskNameContainsAndDslTextContains(search, dslText, pageable); <END> } else { taskDefinitions = repository.findByTaskNameContains(search, pageable); } } else { if (dslText != null) { taskDefinitions = repository.findByDslTextContains(dslText, pageable); } else { taskDefinitions = repository.findAll(pageable); } } final java.util.HashMap<String, TaskDefinition> taskDefinitionMap = new java.util.HashMap<>(); for (TaskDefinition taskDefinition : taskDefinitions) { taskDefinitionMap.put(taskDefinition.getName(), taskDefinition); } final List<TaskExecution> taskExecutions; if (!taskDefinitionMap.isEmpty()) { taskExecutions = this.explorer.getLatestTaskExecutionsByTaskNames( taskDefinitionMap.keySet().toArray(new String[taskDefinitionMap.size()])); } else { taskExecutions = null; } final Page<TaskExecutionAwareTaskDefinition> taskExecutionAwareTaskDefinitions = taskDefinitions .map(new TaskDefinitionConverter(taskExecutions)); PagedModel<TaskDefinitionResource> taskDefinitionResources = assembler.toModel(taskExecutionAwareTaskDefinitions, new Assembler(manifest)); updateComposedTaskElement(taskDefinitionResources.getContent()); return taskDefinitionResources; }</code><technical_language>this query is required. task definition names unique in dataflow. In this case want throw a TaskQueryParamException (a new type of exception) stating request dsltext search time. add new TaskQueryParamException RestControllerAdvice here: <LINK_0></technical_language>

Target:
public PagedModel<TaskDefinitionResource> list(Pageable pageable, @RequestParam(required = false) String search, @RequestParam(required = false) boolean manifest, @RequestParam(required = false) String dslText, PagedResourcesAssembler<TaskExecutionAwareTaskDefinition> assembler) { final Page<TaskDefinition> taskDefinitions; if (search != null) { if (dslText != null) { throw new TaskQueryParamException(new String[] {"search", "dslText"}); } else { taskDefinitions = repository.findByTaskNameContains(search, pageable); } } else { if (dslText != null) { taskDefinitions = repository.findByDslTextContains(dslText, pageable); } else { taskDefinitions = repository.findAll(pageable); } } final java.util.HashMap<String, TaskDefinition> taskDefinitionMap = new java.util.HashMap<>(); for (TaskDefinition taskDefinition : taskDefinitions) { taskDefinitionMap.put(taskDefinition.getName(), taskDefinition); } final List<TaskExecution> taskExecutions; if (!taskDefinitionMap.isEmpty()) { taskExecutions = this.explorer.getLatestTaskExecutionsByTaskNames( taskDefinitionMap.keySet().toArray(new String[taskDefinitionMap.size()])); } else { taskExecutions = null; } final Page<TaskExecutionAwareTaskDefinition> taskExecutionAwareTaskDefinitions = taskDefinitions .map(new TaskDefinitionConverter(taskExecutions)); PagedModel<TaskDefinitionResource> taskDefinitionResources = assembler.toModel(taskExecutionAwareTaskDefinitions, new Assembler(manifest)); updateComposedTaskElement(taskDefinitionResources.getContent()); return taskDefinitionResources; }