flowable/flowable-engine · error · org.activiti.engine.ActivitiException

deployment doesn't contain any rules

Error message

deployment ${deploymentId} doesn't contain any rules

What it means

After successfully loading and deploying the deployment entity, RulesHelper looks up the cached KieBase for the deploymentId. If the KieBase is still null, the deployment exists but contained no .drl/rules resources that produced a knowledge base, so it throws ActivitiException.

Solutions

  1. Verify the deployment actually contains rule resources (.drl files); list them via RepositoryService.getDeploymentResourceNames(deploymentId).
  2. Deploy the rules artifact (bar/zip with .drl files) separately and reference that deployment id in the rule task.
  3. Check the rule files are named with the expected extension and are packaged into the deployment archive.
  4. Ensure the rule-task attribute references the deployment containing rules, not just any process deployment.

Example fix

// before
repositoryService.createDeployment().addClasspathResource("processes/order.bpmn20.xml").deploy();
ruleTask flowable:rulesDeployment="order-deployment" // points at BPMN-only deployment
// after
repositoryService.createDeployment().addClasspathResource("rules/order-rules.bar").deploy();
<!-- rule task references the deployment that contains the .drl resources -->
Defensive patterns

Strategy: validation

Validate before calling

List<String> names = repositoryService.getDeploymentResourceNames(deploymentId);
boolean hasRules = names.stream().anyMatch(n -> n.endsWith(".drl"));
if (!hasRules) throw new IllegalStateException("deployment has no .drl resources: " + deploymentId);

Prevention

When it happens

Trigger: findKnowledgeBaseByDeploymentId is called for a deployment whose resources contain no Drools rule files (.drl/.bpmn rule assets), so DeploymentManager.deploy never populated a KieBase in knowledgeBaseCache for that id.

Common situations: Pointing a rule task at a deployment that only contains BPMN files, deploying rules with the wrong resource suffix so they are not recognized, rules dropped from the deployment when packaging the bar file, mixing up the BPMN deployment id with the rules deployment id.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/rules/RulesHelper.java:50

                .getDeploymentManager()
                .getKnowledgeBaseCache();

        KieBase knowledgeBase = (KieBase) knowledgeBaseCache.get(deploymentId);
        if (knowledgeBase == null) {
            DeploymentEntity deployment = Context
                    .getCommandContext()
                    .getDeploymentEntityManager()
                    .findDeploymentById(deploymentId);
            if (deployment == null) {
                throw new ActivitiObjectNotFoundException("no deployment with id " + deploymentId, Deployment.class);
            }
            Context
                    .getProcessEngineConfiguration()
                    .getDeploymentManager()
                    .deploy(deployment);
            knowledgeBase = (KieBase) knowledgeBaseCache.get(deploymentId);
            if (knowledgeBase == null) {
                throw new ActivitiException("deployment " + deploymentId + " doesn't contain any rules");
            }
        }
        return knowledgeBase;
    }
}

View on GitHub (pinned to d6d39ce1c6)