flowable/flowable-engine · warning · FlowableObjectNotFoundException

Case definition with id '${caseDefinition.getId()}' has no i

Error message

Case definition with id '${caseDefinition.getId()}' has no image.

What it means

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.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionImageResource.java:63

    @ApiOperation(value = "Get a case definition image", tags = { "Case Definitions" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates request was successful and the case definitions are returned"),
            @ApiResponse(code = 404, message = "Indicates the requested case definition was not found.")
    })
    @GetMapping(value = "/cmmn-repository/case-definitions/{caseDefinitionId}/image", produces = MediaType.IMAGE_PNG_VALUE)
    public ResponseEntity<byte[]> getImageResource(@ApiParam(name = "caseDefinitionId") @PathVariable String caseDefinitionId) {
        CaseDefinition caseDefinition = getCaseDefinitionFromRequest(caseDefinitionId);
        try (final InputStream imageStream = repositoryService.getCaseDiagram(caseDefinition.getId())) {
            if (imageStream != null) {
                HttpHeaders responseHeaders = new HttpHeaders();
                responseHeaders.set("Content-Type", MediaType.IMAGE_PNG_VALUE);
                try {
                    return new ResponseEntity<>(IOUtils.toByteArray(imageStream), responseHeaders, HttpStatus.OK);
                } catch (Exception e) {
                    throw new FlowableException("Error reading image stream", e);
                }
            } else {
                throw new FlowableObjectNotFoundException("Case definition with id '" + caseDefinition.getId() + "' has no image.");
            }
            
        } catch (IOException e) {
            throw new FlowableException("Error reading image stream", e);
        }
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Deploy a case definition that includes a valid diagram resource, or re-save the model in the modeler so an image is generated.
  2. Call the resource endpoints only for definitions known to contain diagrams.
  3. Treat this 404 as expected and return a placeholder in your UI when no image exists.
  4. Check Flowable version support for CMMN diagram generation.
Defensive patterns

Strategy: fallback

Validate before calling

if (!caseDefinition.hasStartFormOrDiagramResource()) { /* skip image fetch */ }

Try / catch

try { return fetchImage(id); } catch (FlowableObjectNotFoundException e) { return placeholderImage(); }

Prevention

When it happens

Trigger: 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.

Common situations: Models authored without a visual designer; deployments stripped of image resources; definitions where image generation is disabled or unsupported for that model type.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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