flowable/flowable-engine · warning · FlowableObjectNotFoundException

Decision with id '<decisionId>' has no image.

Error message

Decision with id '<decisionId>' has no image.

What it means

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.

Source

Thrown at modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionImageResource.java:64

    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates request was successful and the decision requirements diagram image returned"),
            @ApiResponse(code = 404, message = "Indicates the requested decision requirements diagram image was not found.")
    })
    @GetMapping(value = "/dmn-repository/decisions/{decisionId}/image", produces = MediaType.IMAGE_PNG_VALUE)
    public ResponseEntity<byte[]> getImageResource(@ApiParam(name = "decisionId") @PathVariable String decisionId) {
        DmnDecision decision = getDecisionFromRequest(decisionId);
        
        try (final InputStream imageStream = dmnRepositoryService.getDecisionRequirementsDiagram(decision.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("Decision with id '" + decision.getId() + "' has no image.");
            }
            
        } catch (IOException e) {
            throw new FlowableException("Error reading image stream", e);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Deploy the decision with an associated diagram resource so an image is generated and stored.
  2. Re-export the .dmn from Flowable Modeler including the diagram, and redeploy.
  3. Handle 404 on the image endpoint in the client UI and fall back to rendering the DMN XML as text or a default placeholder.
  4. Check resource existence first via the deployment resources list (GET /dmn-repository/deployments/{id}/resources) before requesting the image.

Example fix

// before
def fetchDecisionImage(id) { return get('/dmn-repository/decision-tables/' + id + '/image'); }
// after
def fetchDecisionImage(id) {
  const resources = get('/dmn-repository/deployments/' + id + '/resources');
  if (!resources.some(r => r.type === 'image' || r.name.endsWith('.png'))) return null;
  return get('/dmn-repository/decision-tables/' + id + '/image');
}
Defensive patterns

Strategy: fallback

Validate before calling

const resources = await get(`/dmn-repository/deployments/${deploymentId}/resources`);
const hasImage = resources.some(r => r.mediaType?.startsWith('image/') || r.name.endsWith('.png'));
if (!hasImage) return null;

Type guard

function hasDecisionImage(decision) { return Boolean(decision && decision.hasGraphicalNotation === true); }

Try / catch

try { return await getImage(decisionId); }
catch (e) { if (e.status === 404 || /has no image/.test(e.message)) return renderPlaceholder(decisionId); throw e; }

Prevention

When it happens

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

Common situations: 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.

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/fecc75bcd9e2c511. Report an issue: GitHub.