flowable/flowable-engine · error · FlowableObjectNotFoundException

Cannot find case definition for id:

Error message

Cannot find case definition for id: 

What it means

GetDecisionsForCaseDefinitionCmd first resolves the CaseDefinition via CaseDefinitionUtil.getCaseDefinition. If no case definition matches the supplied caseDefinitionId, it throws FlowableObjectNotFoundException typed to CaseDefinition. This surfaces a wrong or unknown case definition id rather than a missing decision table.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetDecisionsForCaseDefinitionCmd.java:55

/**
 * @author Tijs Rademakers
 */
public class GetDecisionsForCaseDefinitionCmd implements Command<List<DmnDecision>>, Serializable {

    private static final long serialVersionUID = 1L;
    protected String caseDefinitionId;
    protected DmnRepositoryService dmnRepositoryService;

    public GetDecisionsForCaseDefinitionCmd(String caseDefinitionId) {
        this.caseDefinitionId = caseDefinitionId;
    }

    @Override
    public List<DmnDecision> execute(CommandContext commandContext) {
        CaseDefinition caseDefinition = CaseDefinitionUtil.getCaseDefinition(caseDefinitionId);
        
        if (caseDefinition == null) {
            throw new FlowableObjectNotFoundException("Cannot find case definition for id: " + caseDefinitionId, CaseDefinition.class);
        }
        
        Case caseModel = CaseDefinitionUtil.getCase(caseDefinitionId);

        if (caseModel == null) {
            throw new FlowableObjectNotFoundException("Cannot find case definition for id: " + caseDefinitionId, Case.class);
        }

        dmnRepositoryService = CommandContextUtil.getDmnEngineConfiguration(commandContext).getDmnRepositoryService();
        if (dmnRepositoryService == null) {
            throw new FlowableException("DMN repository service is not available");
        }

        List<DmnDecision> decision = getDecisionsFromModel(caseModel, caseDefinition);

        return decision;
    }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Look up the current case definition id via RepositoryService.createCaseDefinitionQuery().latestVersion() and use its id
  2. Verify the CMMN deployment actually exists in the connected database
  3. Correct the caseDefinitionId (check for typos or stale/version-specific ids)
  4. Re-deploy the CMMN model if it is missing from the target environment

Example fix

// before
List<DmnDecision> decisions = cmmnEngineConfiguration.getCommandExecutor()
    .execute(new GetDecisionsForCaseDefinitionCmd("myCaseDef"));
// after
CaseDefinition cd = repositoryService.createCaseDefinitionQuery()
    .caseDefinitionKey("myCaseDef").latestVersion().singleResult();
if (cd != null) {
    List<DmnDecision> decisions = ... new GetDecisionsForCaseDefinitionCmd(cd.getId());
}
Defensive patterns

Strategy: validation

Validate before calling

CaseDefinition cd = repositoryService.createCaseDefinitionQuery().caseDefinitionId(id).singleResult(); // null check before use

Try / catch

try { return getDecisionsForCaseDefinition(id); } catch (FlowableObjectNotFoundException e) { log.warn("No case definition {}: {}", id, e.getMessage()); return Collections.emptyList(); }

Prevention

When it happens

Trigger: Calling getDecisionsForCaseDefinition(caseDefinitionId) with an id not present in ACT_RE_CASEDEF — wrong id, id from another engine/database, or a case definition that was deleted.

Common situations: Hard-coded definition ids that break after redeployment (ids are version-specific); environment mismatch (test id used in prod); DB not populated because deployments never ran.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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