{"record":{"id":"fecc75bcd9e2c511","repo":"flowable/flowable-engine","slug":"decision-with-id-decisionid-has-no-image","errorCode":null,"errorMessage":"Decision with id '<decisionId>' has no image.","messagePattern":"Decision with id '<decisionId>' has no image\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"warning","filePath":"modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionImageResource.java","lineNumber":64,"sourceCode":"    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates request was successful and the decision requirements diagram image returned\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested decision requirements diagram image was not found.\")\n    })\n    @GetMapping(value = \"/dmn-repository/decisions/{decisionId}/image\", produces = MediaType.IMAGE_PNG_VALUE)\n    public ResponseEntity<byte[]> getImageResource(@ApiParam(name = \"decisionId\") @PathVariable String decisionId) {\n        DmnDecision decision = getDecisionFromRequest(decisionId);\n        \n        try (final InputStream imageStream = dmnRepositoryService.getDecisionRequirementsDiagram(decision.getId())) {\n            if (imageStream != null) {\n                HttpHeaders responseHeaders = new HttpHeaders();\n                responseHeaders.set(\"Content-Type\", MediaType.IMAGE_PNG_VALUE);\n                try {\n                    return new ResponseEntity<>(IOUtils.toByteArray(imageStream), responseHeaders, HttpStatus.OK);\n                } catch (Exception e) {\n                    throw new FlowableException(\"Error reading image stream\", e);\n                }\n            } else {\n                throw new FlowableObjectNotFoundException(\"Decision with id '\" + decision.getId() + \"' has no image.\");\n            }\n            \n        } catch (IOException e) {\n            throw new FlowableException(\"Error reading image stream\", e);\n        }\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":72,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionImageResource.java#L46-L72","documentation":"This Flowable DMN REST endpoint (GET /dmn-repository/decision-tables/{id}/image or similar) throws FlowableObjectNotFoundException-subclass behavior when the decision exists but has no generated diagram image. The image is only present if a decision diagram resource was included with the DMN model when it was deployed. The library throws this rather than returning an empty body so clients get a clear 404.","triggerScenarios":"Calling the decision image REST resource for a decision whose deployment did not include a diagram resource (no image file next to the .dmn XML), or the DMN model was created programmatically without setting diagram resource info on the decision entity.","commonSituations":"Deploying .dmn XML files exported without a diagram reference (e.g. via Flowable Modeler text-only export or hand-authored XML), then hitting the image endpoint from a UI that assumes every decision has a visual diagram.","solutions":["Deploy the decision with an associated diagram resource so an image is generated and stored.","Re-export the .dmn from Flowable Modeler including the diagram, and redeploy.","Handle 404 on the image endpoint in the client UI and fall back to rendering the DMN XML as text or a default placeholder.","Check resource existence first via the deployment resources list (GET /dmn-repository/deployments/{id}/resources) before requesting the image."],"exampleFix":"// before\ndef fetchDecisionImage(id) { return get('/dmn-repository/decision-tables/' + id + '/image'); }\n// after\ndef fetchDecisionImage(id) {\n  const resources = get('/dmn-repository/deployments/' + id + '/resources');\n  if (!resources.some(r => r.type === 'image' || r.name.endsWith('.png'))) return null;\n  return get('/dmn-repository/decision-tables/' + id + '/image');\n}","handlingStrategy":"fallback","validationCode":"const resources = await get(`/dmn-repository/deployments/${deploymentId}/resources`);\nconst hasImage = resources.some(r => r.mediaType?.startsWith('image/') || r.name.endsWith('.png'));\nif (!hasImage) return null;","typeGuard":"function hasDecisionImage(decision) { return Boolean(decision && decision.hasGraphicalNotation === true); }","tryCatchPattern":"try { return await getImage(decisionId); }\ncatch (e) { if (e.status === 404 || /has no image/.test(e.message)) return renderPlaceholder(decisionId); throw e; }","preventionTips":["Deploy DMN models with diagram resources included","Check deployment resources before requesting the image","Build UI to render decisions without diagrams gracefully"],"tags":["rest-api","dmn","resource-not-found","flowable"],"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-14T05:17:10.506Z"}