cancel
Showing results for 
Search instead for 
Did you mean: 

The integration of drool + activiti issue

niktyagi88
Champ in-the-making
Champ in-the-making
I am running the business rule task by the activiti API.The process is running by the test case.The class is as follow :

private String filename = "C:/Users/niktyagi88/Documents/workspace-sts-2.7.1.RELEASE/ActivitiDemo/src/main/resources/diagrams/MyProcess.bpmn";

private String rulename = "C:/Users/niktyagi88/Documents/workspace-sts-2.7.1.RELEASE/ActivitiDemo/src/main/resources/diagrams/Sample.drl";

@Test
public void startProcess() throws Exception {

RepositoryService repositoryService = activitiRule.getRepositoryService();   

repositoryService.createDeployment().addInputStream("process1.bpmn20.xml",new FileInputStream(filename)).addInputStream("Sample.drl",new FileInputStream( rulename)).deploy();

RuntimeService runtimeService = activitiRule.getRuntimeService();
      
ProcessInstance processInstance=runtimeService.startProcessInstanceByKey("process1");
}


And the bpmn.20.xml file for business rule task is as follow:

<businessRuleTask id="businessruletask1" name="Business rule task" activiti:rules="demo" activiti:exclude="false"></businessRuleTask>

The drool rule is :

rule "demo"
when
then
System.out.println("HELLO");
end


The exception is :
org.activiti.engine.ActivitiException: deployment 1 doesn't contain any rules.


Please help me to solve the issue.
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi,

Did you also add the following lines to your process engine configuration?


<property name="customPostDeployers">
  <list>
    <bean class="org.activiti.engine.impl.rules.RulesDeployer" />
  </list>
</property>

Best regards,

niktyagi88
Champ in-the-making
Champ in-the-making
@trademak
Thnks  a lot.The problem is solved.

garvitj1
Champ in-the-making
Champ in-the-making
Hi nik can you elaborate on how your issue got resolved.

verakeisey
Champ in-the-making
Champ in-the-making
Have solved it accordding to this. Thanks.

garvitj1
Champ in-the-making
Champ in-the-making
Thanks,

I have also resolved the issue. Smiley Happy