cancel
Showing results for 
Search instead for 
Did you mean: 

BusinessRuleTask as Service Task (Integration with external Drools engine) not working.

rahulkrs
Champ in-the-making
Champ in-the-making
Hi ,

I am trying to use my own Drools engine for some reasons. I created a BusinessRuleTask somthing related to this:
<businessRuleTask id="businessRuleTask" activiti:class="com.my.RuleDelegate" /> I got into two issues:
1. I was expecting if I define a BusinessRuleTask as a ServiceTask then process engine wouldn't ask for Drools API, as my service is going to take care of it, but it is expecting specific Drools API at the time of deployment.

2. I am getting following error on starting the processSmiley Surprisedrg.activiti.engine.ActivitiException: deployment xxxx doesn't contain any rule
s.

I am not sure why it should look drl file in the deployment, as my RuleDelgate to take care of it, what i want to fake the BusinesssRuleTask with Service Task and this what exactly documentation says. ("if you want to plug in your implementation of the rule task, e.g. because you want to use Drools differently or you want to use a completly different rule engine, then you can use the class or expression attribute on the BusinessRuleTask and it will behave exactly like a ServiceTask" - Activiti User Guide 5.12.1)

Any help in this regard is greatly appreciated.

)
4 REPLIES 4

rahulkrs
Champ in-the-making
Champ in-the-making
I used something like:
businessRuleTask id="businessRuleTask" activiti:class=com.test.RuleDelegate"
This didn't work.

frederikherema1
Star Contributor
Star Contributor
The engine can never know "your class" will take care of the DRL files in the deployment, unless you tell him. You can disable the drool-deployer, by the way (just don't include a reference to the org.activiti.engine.impl.rules.RulesDeployer which -supprise- deployed the rules. Or deploy the .DRL-files using a different extension 'eg. my-rools.mydrl'), so the deployer doesn't pick those up. Later, when your custom service-task needs the rules, add all *.mydrl to the knowledge base instead.

Another alternative is to subclass the DroolsDeployer to use whatever knoledgebase/rules you want when .drl-files are deployed…

Thanks a lot Fred ! Can you kindly help me with the doubts below:

"The engine can never know "your class" will take care of the DRL files in the deployment, unless you tell him"
Rahul: I have mentioned businessRuleTask id="businessRuleTask" activiti:class=com.test.RuleDelegate" this should have tell Activiti engine tnat I would use my own Delegate:

2.You can disable the drool-deployer, by the way (just don't include a reference to the org.activiti.engine.impl.rules.RulesDeployer which -supprise- deployed the rule

Rahul: Can you kindly help me with this solution ? I didn't find a way to do it, I have not used Drools anywhere in my deployment.

Thanks,
Rahul


frederikherema1
Star Contributor
Star Contributor
1. That doesn't work… you can only have activiti:class on ServiceTask, ExecutionListener and TaskListener.

2) This is in your process engine configuration. The activiti.cfg.xml file OR spring-context file you're using… In in doubt, add the file to your next reply (wrap in code-block please)