{"record":{"id":"4feadd49d977f522","repo":"flowable/flowable-engine","slug":"cannot-find-process-definition-for-id-processde","errorCode":null,"errorMessage":"Cannot find process definition for id: ${processDefinitionId}","messagePattern":"Cannot find process definition for id: (.+?)","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDecisionsForProcessDefinitionCmd.java","lineNumber":55,"sourceCode":"/**\n * @author Yvo Swillens\n */\npublic class GetDecisionsForProcessDefinitionCmd implements Command<List<DmnDecision>>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String processDefinitionId;\n    protected DmnRepositoryService dmnRepositoryService;\n\n    public GetDecisionsForProcessDefinitionCmd(String processDefinitionId) {\n        this.processDefinitionId = processDefinitionId;\n    }\n\n    @Override\n    public List<DmnDecision> execute(CommandContext commandContext) {\n        ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);\n\n        if (processDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find process definition for id: \" + processDefinitionId, ProcessDefinition.class);\n        }\n\n        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId);\n\n        if (bpmnModel == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find bpmn model for process definition id: \" + processDefinitionId, BpmnModel.class);\n        }\n\n        if (CommandContextUtil.getDmnRepositoryService() == null) {\n            throw new FlowableException(\"DMN repository service is not available\");\n        }\n\n        dmnRepositoryService = CommandContextUtil.getDmnRepositoryService();\n        List<DmnDecision> decisions = getDecisionsFromModel(bpmnModel, processDefinition);\n\n        return decisions;\n    }\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDecisionsForProcessDefinitionCmd.java#L37-L73","documentation":"GetDecisionsForProcessDefinitionCmd lists DMN decisions referenced by a process definition. It resolves the definition via ProcessDefinitionUtil; if null it throws FlowableObjectNotFoundException with the id in the message. The process definition id is valid syntactically but no such definition exists (or was removed), so no decision list can be derived.","triggerScenarios":"managementService/TaskService-level API getDecisionsForProcessDefinition(processDefinitionId) with an unknown id; an id from a definition deleted via deleteDeployment; ids referencing a different tenant/engine scope where the definition isn't visible.","commonSituations":"Environments with multiple tenants passing ids across tenant boundaries; cleanup jobs deleting deployments while caches hold old ids; hand-written ids in tests/config.","solutions":["Validate the id first: repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() must return a result before listing decisions","Use processDefinitionKey + latest version resolution instead of raw ids stored in config","Check that the deployment containing the definition was not deleted and matches the tenant","Cache process definition ids only in sync with deployment events"],"exampleFix":"// before\nList<DmnDecision> ds = runtimeService.getDecisionsForProcessDefinition(defId); // defId may be stale\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(defId).singleResult();\nif (pd != null) {\n    List<DmnDecision> ds = runtimeService.getDecisionsForProcessDefinition(defId);\n}","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(defId).singleResult();\nif (pd == null) return Collections.emptyList();\nList<DmnDecision> ds = runtimeService.getDecisionsForProcessDefinition(defId);","typeGuard":null,"tryCatchPattern":"try {\n    List<DmnDecision> ds = runtimeService.getDecisionsForProcessDefinition(defId);\n} catch (FlowableObjectNotFoundException e) {\n    // definition removed or wrong tenant\n}","preventionTips":["Resolve definitions by key/latest version rather than stored raw ids","Listen to deployment/delete events to invalidate cached definition ids","Scope ids to the correct tenant and engine"],"tags":["flowable","process-definition","dmn","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}