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 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.
Source
Thrown at modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResource.java:61
protected AppRestResponseFactory appRestResponseFactory;
@Autowired
protected AppRepositoryService appRepositoryService;
@Autowired(required=false)
protected AppRestApiInterceptor restApiInterceptor;
@ApiOperation(value = "Get a app definition", tags = { "App Definitions" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates the app definition was found returned."),
@ApiResponse(code = 404, message = "Indicates the app definition was not found.")
})
@GetMapping(value = "/app-repository/app-definitions/{appDefinitionId}", produces = "application/json")
public AppDefinitionResponse getAppDefinition(@ApiParam(name = "appDefinitionId") @PathVariable String appDefinitionId) {
AppDefinition appDefinition = appRepositoryService.getAppDefinition(appDefinitionId);
if (appDefinition == null) {
throw new FlowableObjectNotFoundException("Could not find an app definition with id '" + appDefinitionId);
}
if (restApiInterceptor != null) {
restApiInterceptor.accessAppDefinitionInfoById(appDefinition);
}
return appRestResponseFactory.createAppDefinitionResponse(appDefinition);
}
@ApiOperation(value = "Execute actions for an app definition", tags = { "App Definitions" },
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(View on GitHub (pinned to d6d39ce1c6)
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.
Example fix
// before
query.taskNameInIgnoreCase(names); // names can be empty
// after
if (names != null && !names.isEmpty()) {
query.taskNameInIgnoreCase(names);
} Defensive patterns
Strategy: validation
Validate before calling
if (names == null || names.isEmpty()) {
return Collections.emptyList(); // or omit the filter
}
query.taskNameInIgnoreCase(names); Type guard
static boolean isApplicable(Collection<String> c) { return c != null && !c.isEmpty(); } Try / catch
try {
query.taskNameInIgnoreCase(names);
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().contains("empty")) { return Collections.emptyList(); }
throw e;
} Prevention
- 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
When it happens
Trigger: Calling taskNameInIgnoreCase(new ArrayList<>()) or taskNameInIgnoreCase(List.of()) or passing a collection that was filtered down to zero elements.
Common situations: 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.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Could not find a deployment with id '<deploymentId>
- ids is an empty collection
- callbackIds is null or empty
- Task name list is empty
- Error retrieving app engine info
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/4d0931ef7fb04f55.
Report an issue: GitHub.