{"record":{"id":"0914a84ca1ae5edf","repo":"flowable/flowable-engine","slug":"process-instance-with-id-processinstanceid-ha","errorCode":null,"errorMessage":"Process instance with id '${processInstanceId}' has no graphical notation defined.","messagePattern":"Process instance with id '(.+?)' has no graphical notation defined\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceDiagramResource.java","lineNumber":85,"sourceCode":"        ProcessDefinition pde = repositoryService.getProcessDefinition(processInstance.getProcessDefinitionId());\n\n        if (pde != null && pde.hasGraphicalNotation()) {\n            BpmnModel bpmnModel = repositoryService.getBpmnModel(pde.getId());\n            ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();\n            InputStream resource = diagramGenerator.generateDiagram(bpmnModel, \"png\", runtimeService.getActiveActivityIds(processInstance.getId()), Collections.emptyList(),\n                    processEngineConfiguration.getActivityFontName(), processEngineConfiguration.getLabelFontName(),\n                    processEngineConfiguration.getAnnotationFontName(), processEngineConfiguration.getClassLoader(), 1.0,processEngineConfiguration.isDrawSequenceFlowNameWithNoLabelDI());\n\n            HttpHeaders responseHeaders = new HttpHeaders();\n            responseHeaders.set(\"Content-Type\", \"image/png\");\n            try {\n                return new ResponseEntity<>(IOUtils.toByteArray(resource), responseHeaders, HttpStatus.OK);\n            } catch (Exception e) {\n                throw new FlowableIllegalArgumentException(\"Error exporting diagram\", e);\n            }\n\n        } else {\n            throw new FlowableIllegalArgumentException(\"Process instance with id '\" + processInstance.getId() + \"' has no graphical notation defined.\");\n        }\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":89,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceDiagramResource.java#L67-L89","documentation":"A process instance diagram can only be rendered if its process definition has graphical information (BPMN DI/diagram interchange). If the definition resolved from the instance has none, getProcessInstanceDiagram throws FlowableIllegalArgumentException stating the instance has no graphical notation defined.","triggerScenarios":"GET /runtime/process-instances/{processInstanceId}/diagram where the underlying BPMN XML was deployed without BPMNDiagram/BPMNPlane DI elements (e.g. built by a tool that omits diagram data, or the DI was stripped). Thrown at ProcessInstanceDiagramResource.java:85.","commonSituations":"BPMN models generated programmatically or exported without layout information; XML edited by hand removing the bpmndi section; old definitions migrated from tools that don't emit DI; requesting diagrams for instances of such definitions.","solutions":["Redeploy the BPMN XML including a valid <bpmndi:BPMNDiagram>/<bpmndi:BPMNPlane> section, or re-export the model from the Flowable modeler with layout saved.","Verify DI presence by fetching the model XML (GET /repository/models or the deployment resource) and checking for bpmndi elements before calling the diagram endpoint.","Handle the error client-side and show a 'no diagram available' state instead of requesting diagrams for such definitions."],"exampleFix":"// before: BPMN without diagram info\n<definitions>...<process id=\"order\"/>...</definitions>\n// after: include DI\n<definitions>...<process id=\"order\"/>\n  <bpmndi:BPMNDiagram id=\"BPMNDiagram_order\"><bpmndi:BPMNPlane bpmnElement=\"order\">...</bpmndi:BPMNPlane></bpmndi:BPMNDiagram>\n</definitions>","handlingStrategy":"validation","validationCode":"String modelXml = restClient.getModelXml(processDefinitionId);\nboolean hasDiagram = modelXml.contains(\"bpmndi:BPMNDiagram\");\nif (!hasDiagram) {\n    // skip diagram request; show 'no diagram available' in UI\n}","typeGuard":null,"tryCatchPattern":"try {\n    byte[] png = restClient.getDiagram(processInstanceId);\n} catch (HttpClientErrorException.BadRequest e) {\n    if (e.getResponseBodyAsString().contains(\"no graphical notation\")) {\n        // render placeholder instead\n    }\n}","preventionTips":["Validate BPMN models include DI before deployment (check for bpmndi elements in CI).","Export models from the Flowable modeler with layout saved.","Handle the no-diagram case gracefully in UIs."],"tags":["rest-api","diagram","bpmn","java"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}