{"record":{"id":"d6b305cb9b15c04d","repo":"flowable/flowable-engine","slug":"case-definition-with-id-casedefinition-getid","errorCode":null,"errorMessage":"Case definition with id '${caseDefinition.getId()}' has no image.","messagePattern":"Case definition with id '(.+?)' has no image\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"warning","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionImageResource.java","lineNumber":63,"sourceCode":"    @ApiOperation(value = \"Get a case definition image\", tags = { \"Case Definitions\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates request was successful and the case definitions are returned\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested case definition was not found.\")\n    })\n    @GetMapping(value = \"/cmmn-repository/case-definitions/{caseDefinitionId}/image\", produces = MediaType.IMAGE_PNG_VALUE)\n    public ResponseEntity<byte[]> getImageResource(@ApiParam(name = \"caseDefinitionId\") @PathVariable String caseDefinitionId) {\n        CaseDefinition caseDefinition = getCaseDefinitionFromRequest(caseDefinitionId);\n        try (final InputStream imageStream = repositoryService.getCaseDiagram(caseDefinition.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(\"Case definition with id '\" + caseDefinition.getId() + \"' has no image.\");\n            }\n            \n        } catch (IOException e) {\n            throw new FlowableException(\"Error reading image stream\", e);\n        }\n    }\n\n}\n","sourceCodeStart":45,"sourceCodeEnd":72,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionImageResource.java#L45-L72","documentation":"If the case definition has no associated diagram image (the resource lookup returned a null stream), the endpoint throws FlowableObjectNotFoundException explaining the definition 'has no image'. This is not an IO failure — the model simply lacks a diagram resource.","triggerScenarios":"GET .../case-definitions/{id}/resolvable-image (or image endpoint) for a case definition deployed without a diagram: no <diagram> element, no BPMNDiagram-style resource referenced, or the CMMN XML has no associated image.","commonSituations":"Models authored without a visual designer; deployments stripped of image resources; definitions where image generation is disabled or unsupported for that model type.","solutions":["Deploy a case definition that includes a valid diagram resource, or re-save the model in the modeler so an image is generated.","Call the resource endpoints only for definitions known to contain diagrams.","Treat this 404 as expected and return a placeholder in your UI when no image exists.","Check Flowable version support for CMMN diagram generation."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (!caseDefinition.hasStartFormOrDiagramResource()) { /* skip image fetch */ }","typeGuard":null,"tryCatchPattern":"try { return fetchImage(id); } catch (FlowableObjectNotFoundException e) { return placeholderImage(); }","preventionTips":["Save models in the modeler so diagrams are generated.","Return a UI placeholder for definitions without images.","Check diagram support for your Flowable version."],"tags":["not-found","diagram","rest-api"],"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"}