cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment * doesn't contain any rules

cdwhitcombe
Champ in-the-making
Champ in-the-making
I've been working on accessing drools rules from within an activiti process and whatever I do doesn't seem to allow this to load up. Reading the forums I have checked to ensure I have the custom post deployers, ensured I have dependencies in the POM that others have stated they have missed, checked with logging up to trace and torn my rule back to a very basic check.

Looking at what is going on in the logs I can see the rules and BPMN file are both found and appear to be loaded into the DB, from there I try to set a variable and fire the process off. I have confirmed (by dropping in a script) that the process is invoked, but I cant figure out why it cant find the business rule.

I have also got the Activiti In Action book but that doesn't cover the use case I have, I don't want to use anything other than the activiti engine (i.e. no rest, no activiti explorer, etc) I just want to be able to do this in code, specifically I don't want to do this in a test case as per the book. Currently I'm using H2 but once this is proven will move to a permanent DB.

Everything has been pretty seamless up to this point so I am guessing its a configuration thing, but I cant find any posts or info that cover this case.

It seems I can only add .txt attachments to my posts here so I've uploaded a very stripped down test project to my blog to demonstrate this not working: http://www.bite-code.com/wp-content/uploads/2014/04/ActivitiDrools.zip

Would appreciate any pointers to what I may have missed.

Thanks,

Chris
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Chris,

there are two issues:
change process engine configuration:

  ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml")
   .buildProcessEngine();
change activiti config to

    <property name="databaseSchemaUpdate" value="true"/>


After that you get

[09/04/14 09:03:43:226 CEST] ERROR org.activiti.engine.impl.interceptor.CommandContext: Error while closing command context
java.lang.UnsupportedOperationException: org.drools.impl.adapters.StatefulKnowledgeSessionAdapter.fireAllRules -> TODO
at org.drools.impl.adapters.StatefulKnowledgeSessionAdapter.fireAllRules(StatefulKnowledgeSessionAdapter.java:65)

it is drool exception - rule was fired

Regards
Martin

cdwhitcombe
Champ in-the-making
Champ in-the-making
Martin,

That's great, thanks for the help. I've got it working now.

Interestingly, that drools issue appears to be fairly common: https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1066969

It seems some methods are getting deprecated in a very odd way, being marked with runtime todo's! You may want to use my code as a test case to find out what new method you need to invoke instead to get it working with Drools 6.0.1, it works fine when I downgrade to 5.6.0

Thanks.

Chris

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Chris.

Could you create Jira ticket for this please. It could be added to the features for the next release. Or you can create pull request if you solve it by yourself.

Regards
Martin