flowable/flowable-engine · error · FlowableException
deployment doesn't contain any rules
Error message
deployment ${deploymentId} doesn't contain any rules What it means
After finding a valid deployment and (re)deploying it via the DeploymentManager, RulesHelper reads the KieBase from the knowledge base cache. If it is still null, the deployment contained no rule artifacts, so no KieBase could be built. This is a content problem: the deployment exists but has no .drl/rules resources.
Solutions
- Add the .drl rule resources to the same deployment as the process: repositoryService.createDeployment().addClasspathResource("rules/rules.drl").deploy().
- Verify the deployment actually contains rules: repositoryService.getDeploymentResourceNames(deploymentId) should list .drl files.
- Ensure RulesDeployer is active in the process engine configuration (it is by default; custom deployers list may have removed it).
Example fix
// before
repositoryService.createDeployment()
.addClasspathResource("processes/orderProcess.bpmn20.xml")
.deploy(); // no rules included
// after
repositoryService.createDeployment()
.addClasspathResource("processes/orderProcess.bpmn20.xml")
.addClasspathResource("rules/orderRules.drl")
.deploy(); Defensive patterns
Strategy: validation
Validate before calling
List<String> resources = repositoryService.getDeploymentResourceNames(deploymentId);
boolean hasRules = resources.stream().anyMatch(n -> n.endsWith(".drl"));
if (!hasRules) {
throw new IllegalStateException("Deployment has no rules (.drl) resources");
} Try / catch
try {
KieBase kb = rulesHelper.findKnowledgeBaseByDeploymentId(deploymentId);
} catch (FlowableException e) {
if (e.getMessage().contains("doesn't contain any rules")) {
// redeploy with .drl resources included
} else {
throw e;
}
} Prevention
- Always bundle .drl rule resources in the same deployment as the process using them
- Verify deployment resource names include .drl files after deploying
- Ensure RulesDeployer is enabled in the engine configuration
When it happens
Trigger: findKnowledgeBaseByDeploymentId(deploymentId) where the deployment exists but contains no rules (no .drl files), so RulesDeployer never registered a knowledge base for it.
Common situations: Deploying a BPMN process that declares a rules task while forgetting to include the .drl resources in the same deployment; deploying only the process and expecting rules from an earlier deployment; rules file filtered out by a build/deploy script.
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
- deployment doesn't contain any rules
- deployment doesn't contain any rules
- no deployment with id
- no deployment with id
- no deployment with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/f87ba76a0f98e02f.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/app/RulesHelper.java:41
/**
* @author Tom Baeyens
*/
public class RulesHelper {
public static KieBase findKnowledgeBaseByDeploymentId(String deploymentId) {
DeploymentCache<Object> knowledgeBaseCache = CommandContextUtil.getProcessEngineConfiguration().getDeploymentManager().getKnowledgeBaseCache();
KieBase knowledgeBase = (KieBase) knowledgeBaseCache.get(deploymentId);
if (knowledgeBase == null) {
DeploymentEntity deployment = CommandContextUtil.getDeploymentEntityManager().findById(deploymentId);
if (deployment == null) {
throw new FlowableObjectNotFoundException("no deployment with id " + deploymentId, Deployment.class);
}
CommandContextUtil.getProcessEngineConfiguration().getDeploymentManager().deploy(deployment);
knowledgeBase = (KieBase) knowledgeBaseCache.get(deploymentId);
if (knowledgeBase == null) {
throw new FlowableException("deployment " + deploymentId + " doesn't contain any rules");
}
}
return knowledgeBase;
}
}
View on GitHub (pinned to d6d39ce1c6)