cancel
Showing results for 
Search instead for 
Did you mean: 

Business Rule Task

sandhya_m
Champ in-the-making
Champ in-the-making
Hi Guys,
Can any one tell why this error is coming when iam trying to run a drl…through a bpnm20.xml

error:
org.activiti.engine.ActivitiException: deployment 20601 doesn't contain any rules

Java code:
              ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
              RepositoryService repositoryService = processEngine.getRepositoryService();
         RuntimeService runtimeService = processEngine.getRuntimeService();
      repositoryService.createDeployment()
      .addClasspathResource("rulesdemo.bpmn20.xml")
      .deploy();
      runtimeService.startProcessInstanceByKey("rulesdemo");


bpnm20.xml:
  <businessRuleTask completionQuantity="1" activiti:rules="demo" id="sid-A917D25A-C3B1-4A83-BB01-FAB530A4CF1E" implementation="other" isForCompensation="false" name="businessRuleTask&#10;" startQuantity="1">

rule:

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


Regards,
Sandhya
15 REPLIES 15

hamed
Champ in-the-making
Champ in-the-making
I have a same problem, I deployed the bar file containing *.drl ! The question here is where *.drl file goes?! How can I find out where it is? And How to solve this problem?
Regards

trademak
Star Contributor
Star Contributor
Hi,

The drl is deployed to the Activiti Engine and will be parsed in the Drools engine.
Did you copy the necessary Drools JARs to your classpath?

Best regards,

hamed
Champ in-the-making
Champ in-the-making
Thank you for your fast reply!
I have added : drools-compiler-5.3.0.Final.jar , drools-core-5.3.0.Final.jar, knowledge-api-5.3.0.Final.jar ,mvel2-2.1.0.drools4.jar ! By the way, I'm working  with Junit, I'm getting prevous exception Smiley Embarasseddeployment * doesn't contain any rules
And I did "almost" whatever you said in this post  > http://forums.activiti.org/en/viewtopic.php?f=6&t=1266&hilit=deployment+doesn%27t+contain+any+rules

hamed
Champ in-the-making
Champ in-the-making
The drl is deployed to the Activiti Engine …
Is it in some table in database ?

trademak
Star Contributor
Star Contributor
Hi,

Did you read the business rule chapter (chapter 12) in the Activiti in Action book?
You can look at the source code examples here:

http://code.google.com/p/activitiinaction/

Yes the DRL is stored as part of the deployment resources. You can use the RepositoryService to retrieve all the resource files of a deployment.

Best regards,

hamed
Champ in-the-making
Champ in-the-making
I'd love to read but …. Anyway , I'll check Code sample Smiley Happy
Thanks