{"record":{"id":"5174553781bf3101","repo":"flowable/flowable-engine","slug":"process-definition-with-id-id-has-no-image","errorCode":null,"errorMessage":"Process definition with id '${id}' has no image.","messagePattern":"Process definition with id '(.+?)' has no image\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionImageResource.java","lineNumber":65,"sourceCode":"            @ApiResponse(code = 200, message = \"Indicates request was successful and the process-definitions are returned\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested process definition was not found.\")\n    })\n    @GetMapping(value = \"/repository/process-definitions/{processDefinitionId}/image\", produces = MediaType.IMAGE_PNG_VALUE)\n    public ResponseEntity<byte[]> getModelResource(@ApiParam(name = \"processDefinitionId\") @PathVariable String processDefinitionId) {\n        ProcessDefinition processDefinition = getProcessDefinitionFromRequest(processDefinitionId);\n        \n        try (final InputStream imageStream = repositoryService.getProcessDiagram(processDefinition.getId())) {\n\t        if (imageStream != null) {\n\t            HttpHeaders responseHeaders = new HttpHeaders();\n\t            responseHeaders.set(\"Content-Type\", MediaType.IMAGE_PNG_VALUE);\n\t            try {\n\t                return new ResponseEntity<>(IOUtils.toByteArray(imageStream), responseHeaders, HttpStatus.OK);\n\t            } catch (Exception e) {\n\t                throw new FlowableException(\"Error reading image stream\", e);\n\t            }\n\t            \n\t        } else {\n\t            throw new FlowableIllegalArgumentException(\"Process definition with id '\" + processDefinition.getId() + \"' has no image.\");\n\t        }\n        \n        } catch (IOException e) {\n        \tthrow new FlowableException(\"Error reading image stream\", e);\n        }\n    }\n\n}\n","sourceCodeStart":47,"sourceCodeEnd":74,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionImageResource.java#L47-L74","documentation":"Thrown when a process definition has no diagram/image resource attached. Flowable requires a diagram-capable resource (e.g. BPMN XML containing di:Diagram or a PNG) to render the image; without one it raises FlowableIllegalArgumentException instead of returning an empty body.","triggerScenarios":"GET the process definition image endpoint for a definition deployed without a diagram (no DiagramElementInfo / no image generated).","commonSituations":"Deploying BPMN XML without BPMNDI diagram interchange information; deployments created programmatically without diagram generation; older models authored in text editors.","solutions":["Redeploy the BPMN XML including BPMNDI (di:BPMNDiagram) elements so Flowable can generate an image","Deploy an explicit PNG resource alongside the XML","Check the definition resource first and skip image fetch when absent"],"exampleFix":"// before\n<process id=\"p\">...</process> <!-- no BPMNDI -->\n// after\n<definitions>\n  <process id=\"p\">...</process>\n  <bpmndi:BPMNDiagram>...</bpmndi:BPMNDiagram>\n</definitions>","handlingStrategy":"fallback","validationCode":"const resources = await api.getDefinitionResources(defId);\nconst hasDiagram = resources.some(r => /\\.(png|svg|bpmn(20)?xml)?$/.test(r.name) && r.hasDiagram);","typeGuard":"const hasImage = (def) => def != null && def.diagramResourceName != null;","tryCatchPattern":"try { img = await api.getDefinitionImage(defId); }\ncatch (e) { if (e.status === 400 && /has no image/.test(e.message)) img = null; else throw e; }","preventionTips":["Include BPMNDI diagram data in deployed BPMN XML","Deploy explicit PNG resources for models without DI","Check definition resources before requesting the image"],"tags":["rest","process-diagram","deployment"],"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-18T11:17:12.947Z"}