AnsweredAssumed Answered

Deploying a drools rule file using the API

Question asked by surreal1991 on Aug 29, 2014
Latest reply on Sep 1, 2014 by surreal1991
Hi,

I'm trying to figure out Activiti and I'm stuck on trying to get a Business Rule Task working.

My .drl file contains:

//created on: 2014-08-29
package rules

rule "rule1"
    when
        eval(true)
    then
        System.out.println("+++   rule1");
end


And I deploy it in Java as such:

repositoryService.createDeployment().addInputStream(rule, new FileInputStream(pathToRule)).addInputStream(processName, new FileInputStream(pathToProcess)).deploy();


In the eclipse designer my business rule task properties are:
<businessRuleTask id="businessruletask1" name="Business rule task" activiti:rules="rule1"></businessRuleTask>


The error I'm getting is: deployment 1 doesn't contain any rules.

The deployment seems to go ok:
2014-08-29 17:19:47 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource business1.drl
2014-08-29 17:19:47 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource proces_3.bpmn20.xml

Where could the problem be? I have read previously that I have to deploy a .BAR file with the .drl file inside, but that seems to be the case for Activiti Explorer. The rule is pretty straightforward, and the deployment seems to be processed successfully. Is there a problem with my Business Task properties? I have read the documentation but tbh it's not very clear on many things, it does say that "we need to define the input and result variables" but if I'm correct those are the variables used in the rule and the resulting process variable so it should not apply to my simple rule.

Thanks in advance for the help.

Outcomes