flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find an app definition with id '<appDefinitionId>'
Error message
Could not find an app definition with id '<appDefinitionId>'.
What it means
Thrown by taskNameInIgnoreCase(Collection) when the query already has an exact taskName filter set. A historic task query may combine the ignore-case IN list with only one name-matching strategy, and an exact-name equality filter is incompatible with it. This fail-fast check prevents contradictory SQL.
Source
Thrown at modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResource.java:90
notes = "Execute actions for an app definition (Update category)")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates action has been executed for the specified app definition. (category altered)"),
@ApiResponse(code = 400, message = "Indicates no category was defined in the request body."),
@ApiResponse(code = 404, message = "Indicates the requested app definition was not found.")
})
@PutMapping(value = "/app-repository/app-definitions/{appDefinitionId}", produces = "application/json")
public AppDefinitionResponse executeAppDefinitionAction(
@ApiParam(name = "appDefinitionId") @PathVariable String appDefinitionId,
@ApiParam(required = true) @RequestBody AppDefinitionActionRequest actionRequest) {
if (actionRequest == null) {
throw new FlowableIllegalArgumentException("No action found in request body.");
}
AppDefinition appDefinition = appRepositoryService.getAppDefinition(appDefinitionId);
if (appDefinition == null) {
throw new FlowableObjectNotFoundException("Could not find an app definition with id '" + appDefinitionId + "'.", AppDefinition.class);
}
if (restApiInterceptor != null) {
restApiInterceptor.accessAppDefinitionInfoById(appDefinition);
}
if (actionRequest.getCategory() != null) {
// Update of category required
appRepositoryService.setAppDefinitionCategory(appDefinition.getId(), actionRequest.getCategory());
// No need to re-fetch the AppDefinition entity, just update category in response
AppDefinitionResponse response = appRestResponseFactory.createAppDefinitionResponse(appDefinition);
response.setCategory(actionRequest.getCategory());
return response;
}
throw new FlowableIllegalArgumentException("Invalid action: '" + actionRequest.getAction() + "'.");
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Remove the taskName(...) call and keep only taskNameInIgnoreCase.
- If both an exact match and an IN list are needed, add the exact name to the IN list instead of a separate taskName call.
- Make filter-building logic mutually exclusive (if/else) so only one name criterion is applied.
Example fix
// before
query.taskName("Invoice");
query.taskNameInIgnoreCase(List.of("Invoice", "Receipt")); // throws
// after
query.taskNameInIgnoreCase(List.of("Invoice", "Receipt")); Defensive patterns
Strategy: validation
Validate before calling
if (query.getTaskName() != null) {
names = new ArrayList<>(names); names.add(query.getTaskName()); // merge instead of mixing
}
query.taskNameInIgnoreCase(names); Try / catch
try {
query.taskNameInIgnoreCase(names);
} catch (FlowableIllegalArgumentException e) {
throw new IllegalStateException("Conflicting name filters on historic task query", e);
} Prevention
- Apply only one task-name criterion per query object
- Fold an exact taskName value into the IN list rather than setting both
- Use if/else when assembling optional filters
When it happens
Trigger: Calling taskName("x") (or historicProcessVariables-style name setters) followed by taskNameInIgnoreCase(...), or the reverse order, on the same HistoricTaskInstanceQuery instance.
Common situations: Incremental query building where optional filters from different code paths both get applied; copying a template query that already sets taskName and then adding the IN filter.
Related errors
- baseUrl can not be null
- Invalid action: '<action>'.
- Could not find an app definition with id '<appDefinitionId>
- Cannot combine onlyExternalWorkers() with onlyMessages() in
- Cannot combine onlyMessages() with onlyExternalWorkers() in
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/de148bdd5534d6fd.
Report an issue: GitHub.