flowable/flowable-engine · error · FlowableObjectNotFoundException
Cannot find bpmn model for process definition id: ${processD
Error message
Cannot find bpmn model for process definition id: ${processDefinitionId} What it means
FlowableObjectNotFoundException thrown by GetDecisionsForProcessDefinitionCmd.execute when ProcessDefinitionUtil.getBpmnModel(processDefinitionId) returns null. The process definition id was resolvable (or the util returned nothing usable), but no BpmnModel could be loaded for it, so the command cannot read decision keys from the model. Flowable throws this because decision-table / DMN references are attached to the BPMN model, which is mandatory for this lookup.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDecisionsForProcessDefinitionCmd.java:61
protected String processDefinitionId;
protected DmnRepositoryService dmnRepositoryService;
public GetDecisionsForProcessDefinitionCmd(String processDefinitionId) {
this.processDefinitionId = processDefinitionId;
}
@Override
public List<DmnDecision> execute(CommandContext commandContext) {
ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);
if (processDefinition == null) {
throw new FlowableObjectNotFoundException("Cannot find process definition for id: " + processDefinitionId, ProcessDefinition.class);
}
BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId);
if (bpmnModel == null) {
throw new FlowableObjectNotFoundException("Cannot find bpmn model for process definition id: " + processDefinitionId, BpmnModel.class);
}
if (CommandContextUtil.getDmnRepositoryService() == null) {
throw new FlowableException("DMN repository service is not available");
}
dmnRepositoryService = CommandContextUtil.getDmnRepositoryService();
List<DmnDecision> decisions = getDecisionsFromModel(bpmnModel, processDefinition);
return decisions;
}
protected List<DmnDecision> getDecisionsFromModel(BpmnModel bpmnModel, ProcessDefinition processDefinition) {
Set<String> decisionKeys = new HashSet<>();
List<DmnDecision> decisions = new ArrayList<>();
List<ServiceTask> serviceTasks = bpmnModel.getMainProcess().findFlowElementsOfType(ServiceTask.class, true);
for (ServiceTask serviceTask : serviceTasks) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Verify the process definition exists and its deployment still contains the BPMN XML resource: RepositoryService.getDeploymentResourceNames(deploymentId).
- Catch FlowableObjectNotFoundException and treat the id as invalid; re-resolve the latest definition id via RepositoryService.createProcessDefinitionQuery().latestVersion().
- If data is inconsistent, redeploy the BPMN file to recreate the model resource, or repair the deployment rows in ACT_RE_PROCDEF / ACT_GE_BYTEARRAY.
- Confirm the DMN repository service is available in the engine configuration if running in a standalone/custom engine setup.
Example fix
// before
List<DmnDecision> decisions = repositoryService.getDecisionsForProcessDefinition(unknownId);
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult();
if (pd == null) throw new IllegalArgumentException("Unknown process definition: " + id);
List<DmnDecision> decisions = repositoryService.getDecisionsForProcessDefinition(id); Defensive patterns
Strategy: try-catch
Validate before calling
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult();
if (pd == null) throw new IllegalArgumentException("unknown processDefinitionId: " + id); Type guard
boolean isValidDefinitionId(String id) {
return id != null && !id.isBlank()
&& repositoryService.createProcessDefinitionQuery().processDefinitionId(id).count() > 0;
} Try / catch
try {
return repositoryService.getDecisionsForProcessDefinition(id);
} catch (FlowableObjectNotFoundException e) {
log.warn("No BPMN model for definition {}: {}", id, e.getMessage());
return Collections.emptyList();
} Prevention
- Always deploy via the standard RepositoryService deployment builder so BPMN resources are stored with the deployment.
- Verify deployment resources after deploy (getDeploymentResourceNames) in integration tests.
- Resolve definition ids through ProcessDefinitionQuery rather than caching raw ids.
- Ensure the DMN engine is wired up when using decision-table references.
When it happens
Trigger: Calling RepositoryService.getDecisionsForProcessDefinition(processDefinitionId) (or the runtime counterpart) with an id whose BPMN XML resource is missing from the deployment, was corrupted, or whose deployment was deleted; ProcessDefinitionUtil.getBpmnModel resolves the definition but cannot return its BpmnModel.
Common situations: Deployments built manually without the .bpmn resource; database rows deleted or restored inconsistently (process definition present, ACT_GE_BYTEARRAY model resource gone); multi-tenant/case engines (CMMN) where DMN is not wired in; querying a definition from a stale cache after redeploy.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- no decision service with id: '<decisionKey>' found in defini
- deployment does not exist: <deploymentId>
- Decision with id '<decisionId>' has no image.
- decisionTableReferenceKey is a required field extension for
- resource '${resource}' not found
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/e22aeb87a2d1fe2f.
Report an issue: GitHub.