I’m using Drools rule engine from flowable. I created a business rule task and mapped it to the .drl file. I’m creating a process engine from the flowable.cfg.xml file and deploying the process and rules file together.
This is my flowable.cfg.xml
<bean id="processEngineConfiguration"
class = "org.flowable.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
<!-- class="org.flowable.spring.SpringProcessEngineConfiguration">
class="org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration"> -->
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/flowableDroolsSample?autoreconnect = true;DB_CLOSE_DELAY=1000" />
<property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
<property name="jdbcUsername" value="root" />
<property name="jdbcPassword" value="password" />
<property name="asyncExecutorActivate" value="false" />
<property name="databaseSchemaUpdate" value="true"/>
<property name="customPostDeployers">
<list>
<bean class="org.flowable.engine.impl.rules.RulesDeployer" />
</list>
</property>
</bean>
I’m creating process engine and deploying it as below
this.processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml").buildProcessEngine();
this.repositoryService = processEngine.getRepositoryService();
this.runtimeService= processEngine.getRuntimeService();
Deployment deployment =
repositoryService
.createDeployment()
.addClasspathResource("MyProcess.bpmn")
.addClasspathResource("rules/rules.drl")
.deploy();
But it couldn’t get knowledge base from deployment ID. Throwing an error deployment doesn’t contain any rules.
Thanks in advance.