flowable/flowable-engine · error · ActivitiException

ProcessDefinition " + processDefinitionId + " does not…

Error message

ProcessDefinition " + processDefinitionId + " does not exists

What it means

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.

Solutions

  1. Verify the id is a real process definition id via repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() before calling
  2. Check you are not passing a deployment id or process instance id by mistake
  3. Confirm the definition was not deleted and that you are connected to the right engine/tenant database
  4. Wrap the call in a null/exists pre-check and handle the ActivitiException gracefully

Example fix

// before
ObjectNode summary = dynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId);
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
        .processDefinitionId(processDefinitionId).singleResult();
if (pd == null) {
    throw new IllegalArgumentException("Unknown process definition id: " + processDefinitionId);
}
ObjectNode summary = dynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId);
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
        .processDefinitionId(processDefinitionId).singleResult();
if (pd == null) { throw new IllegalArgumentException("Unknown process definition id: " + processDefinitionId); }
dynamicBpmnService.getDynamicProcessDefinitionSummary(processDefinitionId);

Type guard

boolean definitionExists(RepositoryService rs, String id) {
    return id != null && rs.createProcessDefinitionQuery().processDefinitionId(id).count() > 0;
}

Try / catch

try {
    ObjectNode summary = dynamicBpmnService.getDynamicProcessDefinitionSummary(id);
} catch (ActivitiException e) {
    if (e.getMessage() != null && e.getMessage().contains("does not exists")) {
        log.warn("Process definition {} not found", id);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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/ecc0c27c9ef3a08e. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DynamicBpmnServiceImpl.java:355

    }

    @Override
    public void resetProperty(String elementId, String property, ObjectNode infoNode) {
        ObjectNode path = (ObjectNode) infoNode.path(BPMN_NODE).path(elementId);
        if (!path.isMissingNode()) {
            path.remove(property);
        }
    }

    @Override
    public DynamicProcessDefinitionSummary getDynamicProcessDefinitionSummary(String processDefinitionId) {
        ObjectNode infoNode = getProcessDefinitionInfo(processDefinitionId);
        ObjectMapper objectMapper = processEngineConfiguration.getObjectMapper();
        BpmnModel bpmnModel = commandExecutor.execute(new GetBpmnModelCmd(processDefinitionId));

        // aggressive exception. this method should not be called if the process definition does not exists.
        if (bpmnModel == null) {
            throw new ActivitiException("ProcessDefinition " + processDefinitionId + " does not exists");
        }

        // to avoid redundant null checks we create an new node
        if (infoNode == null) {
            infoNode = processEngineConfiguration.getObjectMapper().createObjectNode();
            createOrGetBpmnNode(infoNode);
        }

        return new DynamicProcessDefinitionSummary(bpmnModel, infoNode, objectMapper);
    }

    protected boolean doesElementPropertyExist(String id, String propertyName, ObjectNode infoNode) {
        boolean exists = false;
        if (infoNode.get(BPMN_NODE) != null && infoNode.get(BPMN_NODE).get(id) != null && infoNode.get(BPMN_NODE).get(id).get(propertyName) != null) {
            JsonNode propNode = infoNode.get(BPMN_NODE).get(id).get(propertyName);
            if (!propNode.isNull()) {
                exists = true;
            }

View on GitHub (pinned to d6d39ce1c6)