Hi, I am trying to use business rule task in process but always got exception “java.lang.IllegalArgumentException: Could not parse knowledge.” Here is my spring configuration, is that the right way to deploy drl files? do I need to create kmodule.xml under META-INF? seems the rule file is not being loaded into process engine.
<bean id=“processEngineConfiguration” class=“org.flowable.spring.SpringProcessEngineConfiguration”>
…
<property name=“deploymentResources”>
<list>
<value>classpath*:javaTask.bpmn20.xml</value>
<value>classpath*:rules.drl</value>
</list>
</property>
<property name=“deploymentMode” value=“single-resource” />
</bean>
Then I build the app as a war file in maven, deployed on Tomcat.
<businessRuleTask id=“id” flowable:ruleVariablesInput="${loanRequest}" flowable:rules=“CreditCheckRule”></businessRuleTask>
Anyone has done similar things before? Thanks in advance.
Hi,
Have a look on org.flowable.standalone.rules.RulesDeployerTest in flowable source. There is also
configurationl to get drl running.
Regards
Martin
Hi Martin,
Thanks for your response and I can get it working now based on a post from you years ago. Deployment * doesn’t contain any rules Thanks a lot for your help and a follow up question.
When I use spring to configure processEngineConfiguration-> class=“org.flowable.spring.SpringProcessEngineConfiguration” and processEngine -> class="org.flowable.spring.ProcessEngineFactoryBean, I got the same exception like “Deployment 42154 doesn’t contain any rules”, but when I deploy programmatically as you mentioned before ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(“flowable.cfg.xml”) it’s working fine. Why it fails in spring? restricted by drools? I don’t want to deploy resouces pragrammatically, I want Automatic resource deployment in spring, any ideas? Thanks a lot for your help.
Best Regards
Li
Hi Li.
It is hard to guess why. The better would be to reproduce the issue whit jUnit test.
( mvn archetype:generate -DarchetypeGroupId=org.flowable -DarchetypeArtifactId=flowable-archetype-unittest -DarchetypeVersion=6.2.0 -DgroupId=org.flowable)
Regards
Martin