{"record":{"id":"4d0931ef7fb04f55","repo":"flowable/flowable-engine","slug":"could-not-find-an-app-definition-with-id-appdefi","errorCode":null,"errorMessage":"Could not find an app definition with id '<appDefinitionId>","messagePattern":"Could not find an app definition with id '<appDefinitionId>","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResource.java","lineNumber":61,"sourceCode":"    protected AppRestResponseFactory appRestResponseFactory;\n\n    @Autowired\n    protected AppRepositoryService appRepositoryService;\n    \n    @Autowired(required=false)\n    protected AppRestApiInterceptor restApiInterceptor;\n\n    @ApiOperation(value = \"Get a app definition\", tags = { \"App Definitions\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates the app definition was found returned.\"),\n            @ApiResponse(code = 404, message = \"Indicates the app definition was not found.\")\n    })\n    @GetMapping(value = \"/app-repository/app-definitions/{appDefinitionId}\", produces = \"application/json\")\n    public AppDefinitionResponse getAppDefinition(@ApiParam(name = \"appDefinitionId\") @PathVariable String appDefinitionId) {\n        AppDefinition appDefinition = appRepositoryService.getAppDefinition(appDefinitionId);\n\n        if (appDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an app definition with id '\" + appDefinitionId);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessAppDefinitionInfoById(appDefinition);\n        }\n\n        return appRestResponseFactory.createAppDefinitionResponse(appDefinition);\n    }\n    \n    @ApiOperation(value = \"Execute actions for an app definition\", tags = { \"App Definitions\" },\n            notes = \"Execute actions for an app definition (Update category)\")\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates action has been executed for the specified app definition. (category altered)\"),\n            @ApiResponse(code = 400, message = \"Indicates no category was defined in the request body.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested app definition was not found.\")\n    })\n    @PutMapping(value = \"/app-repository/app-definitions/{appDefinitionId}\", produces = \"application/json\")\n    public AppDefinitionResponse executeAppDefinitionAction(","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResource.java#L43-L79","documentation":"Thrown by HistoricTaskInstanceQuery.taskNameInIgnoreCase(Collection) when the passed collection is non-null but empty. An empty IN list would produce invalid or meaningless SQL, so the builder rejects it. Callers must supply at least one task name.","triggerScenarios":"Calling taskNameInIgnoreCase(new ArrayList<>()) or taskNameInIgnoreCase(List.of()) or passing a collection that was filtered down to zero elements.","commonSituations":"A UI multi-select with nothing selected, an empty search-term list, or a filtered collection (stream().filter(...) with no matches) is passed directly into the query builder.","solutions":["Guard with !taskNames.isEmpty() before calling taskNameInIgnoreCase and omit the filter when empty.","Short-circuit the whole query (return an empty result without hitting the engine) when the input list is empty.","Ensure the upstream code that builds the list guarantees at least one element."],"exampleFix":"// before\nquery.taskNameInIgnoreCase(names); // names can be empty\n\n// after\nif (names != null && !names.isEmpty()) {\n    query.taskNameInIgnoreCase(names);\n}","handlingStrategy":"validation","validationCode":"if (names == null || names.isEmpty()) {\n    return Collections.emptyList(); // or omit the filter\n}\nquery.taskNameInIgnoreCase(names);","typeGuard":"static boolean isApplicable(Collection<String> c) { return c != null && !c.isEmpty(); }","tryCatchPattern":"try {\n    query.taskNameInIgnoreCase(names);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"empty\")) { return Collections.emptyList(); }\n    throw e;\n}","preventionTips":["Treat an empty filter input as 'no filter' and skip the setter call","Short-circuit queries whose filter list is empty instead of hitting the engine","Add unit tests for empty-collection filter paths"],"tags":["flowable","query-builder","empty-collection","validation"],"backgroundTag":"empty-required-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}