flowable/flowable-engine · warning

Invalid reference in diagram interchange definition: could…

Error message

Invalid reference in diagram interchange definition: could not find {}

What it means

During DI (diagram interchange) processing in processDI(), a location (BPMNShape) reference points to an id that does not exist as a flow element, artifact, pool, or lane in the model. The engine logs a warning and skips the shape, so diagram rendering may be incomplete but deployment proceeds.

Solutions

  1. Find the id named in the log and either restore the element or remove its BPMNShape from the bpmndi section
  2. Re-export the diagram from the modeling tool so DI entries are regenerated
  3. Validate the XML so every bpmnElement reference resolves to a defined model element

Example fix

// before
<bpmndi:BPMNShape bpmnElement="deletedTask" .../>
// after
<!-- remove the orphan BPMNShape or re-add the task with id deletedTask -->
Defensive patterns

Strategy: validation

Validate before calling

// Ensure every BPMNShape bpmnElement id exists in the model
Set<String> ids = collectAllModelIds(bpmnModel); // flow elements + artifacts + pools + lanes
for (String ref : bpmnModel.getLocationMap().keySet()) {
    if (!ids.contains(ref)) throw new IllegalArgumentException("Orphan DI shape: " + ref);
}

Prevention

When it happens

Trigger: A bpmndi:BPMNShape whose bpmnElement attribute references an id absent from the process model (not a FlowElement, Artifact, Pool, or Lane); logged in BpmnParse.processDI().

Common situations: Hand-edited BPMN XML with stale ids; modeler export where elements were deleted but DI entries remained; copy-paste of diagram sections referencing renamed elements.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java:354

            bpmnParserHandlers.parseElement(this, sequenceFlow);
        }

    }

    // Diagram interchange
    // /////////////////////////////////////////////////////////////////

    public void processDI() {
        if (!bpmnModel.getLocationMap().isEmpty()) {

            // Verify if all referenced elements exist
            for (String bpmnReference : bpmnModel.getLocationMap().keySet()) {
                if (bpmnModel.getFlowElement(bpmnReference) == null) {
                    // ACT-1625: don't warn when artifacts are referenced from DI
                    if (bpmnModel.getArtifact(bpmnReference) == null) {
                        // check if it's a Pool or Lane, then DI is ok
                        if (bpmnModel.getPool(bpmnReference) == null && bpmnModel.getLane(bpmnReference) == null) {
                            LOGGER.warn("Invalid reference in diagram interchange definition: could not find {}", bpmnReference);
                        }
                    }
                } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof FlowNode)) {
                    LOGGER.warn("Invalid reference in diagram interchange definition: {} does not reference a flow node", bpmnReference);
                }
            }
            for (String bpmnReference : bpmnModel.getFlowLocationMap().keySet()) {
                if (bpmnModel.getFlowElement(bpmnReference) == null) {
                    // ACT-1625: don't warn when artifacts are referenced from DI
                    if (bpmnModel.getArtifact(bpmnReference) == null) {
                        LOGGER.warn("Invalid reference in diagram interchange definition: could not find {}", bpmnReference);
                    }
                } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof SequenceFlow)) {
                    LOGGER.warn("Invalid reference in diagram interchange definition: {} does not reference a sequence flow", bpmnReference);
                }
            }

            for (Process process : bpmnModel.getProcesses()) {

View on GitHub (pinned to d6d39ce1c6)