flowable/flowable-engine · error · FlowableException
deployment doesn't contain any rules
Error message
deployment doesn't contain any rules
What it means
After loading (and, if needed, deploying) the deployment, RulesHelper re-checks the KieBase cache; if no knowledge base was produced, it concludes the deployment contains no rule resources (.drl/.bpmn with rules) and throws FlowableException. The deployment exists but has nothing usable as a KieBase.
Solutions
- Ensure the deployment archive actually contains rule resources (.drl files) when it was created.
- Check the engine has the drools/rules integration configured (KnowledgeBaseBuilder deployed correctly).
- Inspect the deployment resources via repositoryService.getDeploymentResourceNames(deploymentId) to confirm what was deployed.
- Redeploy a dedicated rules archive and use that deployment id.
Example fix
// before
KieBase kb = RulesHelper.findKnowledgeBaseByDeploymentId(processDeploymentId); // no rules inside
// after
List<String> names = repositoryService.getDeploymentResourceNames(deploymentId);
if (names.stream().noneMatch(n -> n.endsWith(".drl"))) {
throw new IllegalStateException("Deployment has no rules: " + deploymentId);
}
KieBase kb = RulesHelper.findKnowledgeBaseByDeploymentId(deploymentId); Defensive patterns
Strategy: validation
Validate before calling
boolean deploymentHasRules(String deploymentId) {
return repositoryService.getDeploymentResourceNames(deploymentId).stream()
.anyMatch(n -> n.endsWith(".drl"));
} Try / catch
try {
return RulesHelper.findKnowledgeBaseByDeploymentId(deploymentId);
} catch (FlowableException e) {
if (e.getMessage().contains("doesn't contain any rules")) {
throw new MissingRulesException(deploymentId, e);
}
throw e;
} Prevention
- Deploy rules into a dedicated archive containing .drl files.
- Verify deployed resource names include rule artifacts before using the rules helper.
- Confirm the drools/rules integration module is on the classpath and configured.
- Do not reuse plain process-deployment ids for rules lookups.
When it happens
Trigger: Calling findKnowledgeBaseByDeploymentId on a deployment that contains only BPMN/XML/other resources but no drools rule artifacts; rule resources failed to compile into a KieBase during deploy; deploying a deployment entity without rules in a rules-using flow.
Common situations: Reusing a plain process deployment id where a rules deployment id is expected; archive missing .drl files; older Flowable versions where rules support requires the flowable-drools integration module and compatible artifacts.
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
- no deployment with id
- bytes array is null
- bytes is null
- Could not find deployment with id
- deployment doesn't contain any rules
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/01a7ec369a346f42.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/rules/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)