{"record":{"id":"1255b10c57d7fd1c","repo":"flowable/flowable-engine","slug":"deployment-deploymentid-doesn-t-contain-any-rul-1255b1","errorCode":null,"errorMessage":"deployment ${deploymentId} doesn't contain any rules","messagePattern":"deployment (.+?) doesn't contain any rules","errorType":"exception","errorClass":"org.activiti.engine.ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/rules/RulesHelper.java","lineNumber":50,"sourceCode":"                .getDeploymentManager()\n                .getKnowledgeBaseCache();\n\n        KieBase knowledgeBase = (KieBase) knowledgeBaseCache.get(deploymentId);\n        if (knowledgeBase == null) {\n            DeploymentEntity deployment = Context\n                    .getCommandContext()\n                    .getDeploymentEntityManager()\n                    .findDeploymentById(deploymentId);\n            if (deployment == null) {\n                throw new ActivitiObjectNotFoundException(\"no deployment with id \" + deploymentId, Deployment.class);\n            }\n            Context\n                    .getProcessEngineConfiguration()\n                    .getDeploymentManager()\n                    .deploy(deployment);\n            knowledgeBase = (KieBase) knowledgeBaseCache.get(deploymentId);\n            if (knowledgeBase == null) {\n                throw new ActivitiException(\"deployment \" + deploymentId + \" doesn't contain any rules\");\n            }\n        }\n        return knowledgeBase;\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":56,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/rules/RulesHelper.java#L32-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the deployment actually contains rule resources (.drl files); list them via RepositoryService.getDeploymentResourceNames(deploymentId).","Deploy the rules artifact (bar/zip with .drl files) separately and reference that deployment id in the rule task.","Check the rule files are named with the expected extension and are packaged into the deployment archive.","Ensure the rule-task attribute references the deployment containing rules, not just any process deployment."],"exampleFix":"// before\nrepositoryService.createDeployment().addClasspathResource(\"processes/order.bpmn20.xml\").deploy();\nruleTask flowable:rulesDeployment=\"order-deployment\" // points at BPMN-only deployment\n// after\nrepositoryService.createDeployment().addClasspathResource(\"rules/order-rules.bar\").deploy();\n<!-- rule task references the deployment that contains the .drl resources -->","handlingStrategy":"validation","validationCode":"List<String> names = repositoryService.getDeploymentResourceNames(deploymentId);\nboolean hasRules = names.stream().anyMatch(n -> n.endsWith(\".drl\"));\nif (!hasRules) throw new IllegalStateException(\"deployment has no .drl resources: \" + deploymentId);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep rule assets (.drl) in a dedicated bar deployment and reference that id.","Verify resource names after each deploy with getDeploymentResourceNames.","Do not confuse the BPMN process deployment id with the rules deployment id."],"tags":["rules","drools","deployment","missing-resource"],"backgroundTag":"empty-result-set","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}