flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a DMN deployment with id '<deploymentId>

Error message

Could not find a DMN deployment with id '<deploymentId>

What it means

The deployment existence check in getDmnDeploymentResourceData throws FlowableObjectNotFoundException("Could not find a DMN deployment with id '<deploymentId>'") when DmnDeploymentQuery.deploymentId(...).singleResult() returns null. The supplied deployment id matches no row in the DMN engine's deployment table.

Source

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

    
    @Autowired(required=false)
    protected DmnRestApiInterceptor restApiInterceptor;

    protected byte[] getDmnDeploymentResourceData(String deploymentId, String resourceName, HttpServletResponse response) {

        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("No deployment id provided");
        }
        if (resourceName == null) {
            throw new FlowableIllegalArgumentException("No resource name provided");
        }

        // Check if deployment exists
        DmnDeploymentQuery deploymentQuery = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId);
        
        DmnDeployment deployment = deploymentQuery.singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find a DMN deployment with id '" + deploymentId);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

        List<String> resourceList = dmnRepositoryService.getDeploymentResourceNames(deploymentId);

        if (resourceList.contains(resourceName)) {
            String contentType = contentTypeResolver.resolveContentType(resourceName);
            response.setContentType(contentType);
            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceName)) {
                return IOUtils.toByteArray(resourceStream);
                
            } catch (Exception e) {
                throw new FlowableException("Error converting resource stream", e);
            }
            

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Confirm the id exists via GET /dmn-repository/deployments before requesting resource data.
  2. Verify the REST app's datasource points at the environment where the DMN deployment lives.
  3. Re-deploy the DMN model if the deployment was deleted and use the returned deployment id.
  4. If the id came from the process engine API, use the corresponding process REST API instead.

Example fix

// before
byte[] data = client.getDmnDeploymentResourceData("123", "d.dmn"); // nonexistent in this env
// after
DmnDeploymentResponse dep = client.getDeployment("123");
if (dep == null) {
    DmnDeploymentResponse created = client.deploy(new ClassPathResource("d.dmn"));
    return client.getDmnDeploymentResourceData(created.getId(), "d.dmn");
}
Defensive patterns

Strategy: try-catch

Validate before calling

boolean exists = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).count() > 0;
if (!exists) deployDmnModel(...); // or refetch id

Try / catch

try {
    return client.getDmnDeploymentResourceData(deploymentId, resourceName);
} catch (FlowableObjectNotFoundException e) {
    deploymentId = redeployAndGetId(resourceName); // deployment gone: redeploy
}

Prevention

When it happens

Trigger: GET /dmn-repository/deployments/{deploymentId}/resource-data/{resourceName} with a nonexistent deploymentId: deleted deployment, id belonging to the BPMN process engine rather than the DMN engine, wrong database/environment, or truncated id.

Common situations: After DB switch or tenant-specific datasource misroute; cleanup jobs purging old deployments; copying ids between dev/test environments; confusing process deployments with DMN deployments (separate tables).

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