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 taskNameLikeIgnoreCase is already set on the query. The two filters are both case-insensitive name predicates and cannot coexist; the builder validates this immediately to avoid generating contradictory SQL.

Source

Thrown at modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResourceDataResource.java:64

    @Autowired
    protected AppRepositoryService appRepositoryService;
    
    @Autowired(required=false)
    protected AppRestApiInterceptor restApiInterceptor;

    @ApiOperation(value = "Get an app definition resource content", nickname = "getAppDefinitionContent", tags = { "App Definitions" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates both app definition and resource have been found and the resource data has been returned."),
            @ApiResponse(code = 404, message = "Indicates the requested app definition was not found or there is no resource with the given id present in the app definition. The status-description contains additional information.")
    })
    @GetMapping(value = "/app-repository/app-definitions/{appDefinitionId}/resourcedata", produces = "application/json")
    @ResponseBody
    public byte[] getAppDefinitionResource(@ApiParam(name = "appDefinitionId") @PathVariable String appDefinitionId, HttpServletResponse response) {
        AppDefinition appDefinition = appRepositoryService.getAppDefinition(appDefinitionId);

        if (appDefinition == null) {
            throw new FlowableObjectNotFoundException("Could not find an app definition with id '" + appDefinitionId);
        }
        if (appDefinition.getDeploymentId() == null) {
            throw new FlowableException("No deployment id available");
        }
        if (appDefinition.getResourceName() == null) {
            throw new FlowableException("No resource name available");
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessAppDefinitionInfoById(appDefinition);
        }

        // Check if deployment exists
        AppDeployment deployment = appRepositoryService.createDeploymentQuery().deploymentId(appDefinition.getDeploymentId()).singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + appDefinition.getDeploymentId());
        }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Remove the taskNameLikeIgnoreCase call and keep only taskNameInIgnoreCase.
  2. If pattern semantics are required, expand the pattern to a known set of names and pass that set to taskNameInIgnoreCase.
  3. Refactor filter assembly into a single mutually exclusive name-criterion selection.

Example fix

// before
query.taskNameLikeIgnoreCase("repo%");
query.taskNameInIgnoreCase(List.of("Report A")); // throws

// after
query.taskNameInIgnoreCase(List.of("Report A", "Report B"));
Defensive patterns

Strategy: validation

Validate before calling

if (query.getTaskNameLikeIgnoreCase() != null) {
    throw new IllegalStateException("Choose either taskNameLikeIgnoreCase or taskNameInIgnoreCase");
}
query.taskNameInIgnoreCase(names);

Try / catch

try {
    query.taskNameInIgnoreCase(names);
} catch (FlowableIllegalArgumentException e) {
    throw new IllegalStateException("Both case-insensitive name filters set on query", e);
}

Prevention

When it happens

Trigger: Calling taskNameLikeIgnoreCase("repo%") followed by taskNameInIgnoreCase(...) (or the reverse) on the same HistoricTaskInstanceQuery instance.

Common situations: UI/API layers that apply optional case-insensitive filters cumulatively; merging a legacy query (using taskNameLikeIgnoreCase) with new code that switched to taskNameInIgnoreCase.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6b78dc405e8e6d72. Report an issue: GitHub.