flowable/flowable-engine · warning

Error while generating process diagram, image will not be…

Error message

Error while generating process diagram, image will not be stored in repository

What it means

During deployment, BpmnDeployer generates a PNG process diagram for each process definition when diagram generation is enabled. If any step of diagram generation throws, this warning is logged, the image is not stored as a deployment resource, and the deployment proceeds because the process remains executable.

Solutions

  1. Add valid BPMNDiagram DI sections to the BPMN XML (re-save from the modeler)
  2. Disable diagram generation: set createDiagramOnDeploy=false on ProcessEngineConfiguration
  3. Check the configured labelFontName/annotationFontName are valid fonts available to the JVM

Example fix

// before
<property name="createDiagramOnDeploy" value="true"/>
// after (if DI cannot be fixed)
<property name="createDiagramOnDeploy" value="false"/>
Defensive patterns

Strategy: validation

Validate before calling

BpmnModel model = converter.convertToBpmnModel(...);
boolean hasDi = model.getLocationMap() != null && !model.getLocationMap().isEmpty();
if (!hasDi) config.setCreateDiagramOnDeploy(false);

Type guard

boolean hasDiagramInfo(BpmnModel m) { return m != null && m.getLocationMap() != null && !m.getLocationMap().isEmpty(); }

Try / catch

try { byte[] png = generator.generateDiagram(...); } catch (Throwable t) { LOGGER.warn("diagram skipped", t); }

Prevention

When it happens

Trigger: createDiagram / ProcessDiagramGenerator throws (e.g. invalid or missing BPMN DI (diagram interchange) information, bad fonts, classloader issues) while isCreateDiagramOnDeploy is true.

Common situations: BPMN XML without BPMNDiagram/BPMNPlane DI sections; missing or incompatible fonts for configured label/annotation font names; corrupted models generated by tools.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/deployer/BpmnDeployer.java:165

                    String diagramResourceName = getDiagramResourceForProcess(resourceName, processDefinition.getKey(), resources);

                    // Only generate the resource when deployment is new to prevent modification of deployment resources
                    // after the process-definition is actually deployed. Also to prevent resource-generation failure every
                    // time the process definition is added to the deployment-cache when diagram-generation has failed the first time.
                    if (deployment.isNew()) {
                        if (processEngineConfiguration.isCreateDiagramOnDeploy() &&
                                diagramResourceName == null && processDefinition.isGraphicalNotationDefined()) {

                            try {
                                byte[] diagramBytes = IoUtil.readInputStream(processEngineConfiguration.getProcessDiagramGenerator().generateDiagram(bpmnParse.getBpmnModel(), "png", processEngineConfiguration.getActivityFontName(),
                                        processEngineConfiguration.getLabelFontName(), processEngineConfiguration.getAnnotationFontName(),
                                        processEngineConfiguration.getClassLoader(),processEngineConfiguration.isDrawSequenceFlowNameWithNoLabelDI()), null);
                                diagramResourceName = getProcessImageResourceName(resourceName, processDefinition.getKey(), "png");
                                createResource(diagramResourceName, diagramBytes, deployment);

                            } catch (Throwable t) { // if anything goes wrong, we don't store the image (the process will still be executable).
                                LOGGER.warn("Error while generating process diagram, image will not be stored in repository", t);
                            }
                        }
                    }

                    processDefinition.setDiagramResourceName(diagramResourceName);
                    processDefinition.setEngineVersion("v5");
                    processDefinitions.add(processDefinition);
                    bpmnModelMap.put(processDefinition.getKey(), bpmnParse.getBpmnModel());
                }
            }
        }

        // check if there are process definitions with the same process key to prevent database unique index violation
        List<String> keyList = new ArrayList<>();
        for (ProcessDefinitionEntity processDefinition : processDefinitions) {
            if (keyList.contains(processDefinition.getKey())) {
                throw new ActivitiException("The deployment contains process definitions with the same key '" + processDefinition.getKey() + "' (process id attribute), this is not allowed");
            }

View on GitHub (pinned to d6d39ce1c6)