{"record":{"id":"ecc0c27c9ef3a08e","repo":"flowable/flowable-engine","slug":"processdefinition-processdefinitionid-does","errorCode":null,"errorMessage":"ProcessDefinition \" + processDefinitionId + \" does not exists","messagePattern":"ProcessDefinition \" \\+ processDefinitionId \\+ \" does not exists","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DynamicBpmnServiceImpl.java","lineNumber":355,"sourceCode":"    }\n\n    @Override\n    public void resetProperty(String elementId, String property, ObjectNode infoNode) {\n        ObjectNode path = (ObjectNode) infoNode.path(BPMN_NODE).path(elementId);\n        if (!path.isMissingNode()) {\n            path.remove(property);\n        }\n    }\n\n    @Override\n    public DynamicProcessDefinitionSummary getDynamicProcessDefinitionSummary(String processDefinitionId) {\n        ObjectNode infoNode = getProcessDefinitionInfo(processDefinitionId);\n        ObjectMapper objectMapper = processEngineConfiguration.getObjectMapper();\n        BpmnModel bpmnModel = commandExecutor.execute(new GetBpmnModelCmd(processDefinitionId));\n\n        // aggressive exception. this method should not be called if the process definition does not exists.\n        if (bpmnModel == null) {\n            throw new ActivitiException(\"ProcessDefinition \" + processDefinitionId + \" does not exists\");\n        }\n\n        // to avoid redundant null checks we create an new node\n        if (infoNode == null) {\n            infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();\n            createOrGetBpmnNode(infoNode);\n        }\n\n        return new DynamicProcessDefinitionSummary(bpmnModel, infoNode, objectMapper);\n    }\n\n    protected boolean doesElementPropertyExist(String id, String propertyName, ObjectNode infoNode) {\n        boolean exists = false;\n        if (infoNode.get(BPMN_NODE) != null && infoNode.get(BPMN_NODE).get(id) != null && infoNode.get(BPMN_NODE).get(id).get(propertyName) != null) {\n            JsonNode propNode = infoNode.get(BPMN_NODE).get(id).get(propertyName);\n            if (!propNode.isNull()) {\n                exists = true;\n            }","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DynamicBpmnServiceImpl.java#L337-L373","documentation":"DynamicBpmnServiceImpl.getDynamicProcessDefinitionSummary() fetches the BPMN model for the given process definition id and throws ActivitiException if the model is null. The comment in the source states this is intentional and 'aggressive': the method should never be called for a process definition id that does not exist. It signals a caller-side contract violation / nonexistent definition rather than a queryable empty result.","triggerScenarios":"Calling dynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId) with an id for which GetBpmnModelCmd returns null: a typo'd or fabricated id, a definition deleted after being cached, an id from another engine/tenant, or an id that was never deployed.","commonSituations":"Stale ids stored in external systems after re-deployment; passing a process instance id or deployment id instead of a process definition id; multi-tenant routing to the wrong engine; tests using made-up ids.","solutions":["Verify the id is a real process definition id via repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() before calling","Check you are not passing a deployment id or process instance id by mistake","Confirm the definition was not deleted and that you are connected to the right engine/tenant database","Wrap the call in a null/exists pre-check and handle the ActivitiException gracefully"],"exampleFix":"// before\nObjectNode summary = dynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId);\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n        .processDefinitionId(processDefinitionId).singleResult();\nif (pd == null) {\n    throw new IllegalArgumentException(\"Unknown process definition id: \" + processDefinitionId);\n}\nObjectNode summary = dynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId);","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n        .processDefinitionId(processDefinitionId).singleResult();\nif (pd == null) { throw new IllegalArgumentException(\"Unknown process definition id: \" + processDefinitionId); }\ndynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId);","typeGuard":"boolean definitionExists(RepositoryService rs, String id) {\n    return id != null && rs.createProcessDefinitionQuery().processDefinitionId(id).count() > 0;\n}","tryCatchPattern":"try {\n    ObjectNode summary = dynamicBpmnService.getDynamicProcessDefinitionSummary(id);\n} catch (ActivitiException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"does not exists\")) {\n        log.warn(\"Process definition {} not found\", id);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Store process definition ids from verified lookups, never hand-typed","Re-validate stored ids after re-deployments or cleanup jobs","Distinguish deployment ids vs process definition ids vs process instance ids","Validate tenant/engine routing so ids resolve in the connected database"],"tags":["java","activiti","resource-not-found","process-definition"],"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"}