cancel
Showing results for 
Search instead for 
Did you mean: 

Business Rule task not updating Java object

mikepoole
Champ in-the-making
Champ in-the-making
I have a business rule task that uses a drl file to update a Java object which was created in a Java Service Task prior to the rule task

I have some printlns in the functions that the drl file triggers so I am confident that the rule task is firing AND evaluating correctly.

The next step in the process is a user task. When I retrieve the values form the Java object to display on the form, they are the pre business task/drools update values

ie:
1. Create Article (my Java object (which implements Serializable)) - set size to 5 and assign Article to process variable "pvArticle"
2. Business Rule task runs and sets size to 50 (Tomcat shows the setSize() method being triggered and this.size being set to 50)
3. User task form has #{pvArticle.getSize()} as the expression - returns 5

What am I doing wrong?

Many thanks

Mike
20 REPLIES 20

mikepoole
Champ in-the-making
Champ in-the-making
Tijs

The applicationContext.xml file in app\apache-tomcat-6.0.32\webapps\activiti-explorer\WEB-INF has the following:

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

And the executable jar file that contains the service task classes is present in app\apache-tomcat-6.0.32\webapps\activiti-explorer\WEB-INF\lib\

Is there anything else I could possibly check?

Thanks

Mike

trademak
Star Contributor
Star Contributor
So let's walk through the test steps then.

1. You deploy a BAR file with the process definition and the rule file to Activiti using the Activiti Explorer.
2. You start a new process instance in the Activiti Explorer
3. You complete the user task in the Activiti Explorer
4. You get an error?

If you get an error in step 4, can you send me the BAR file and the JAR file for the process instance classes (maybe also a copy of the sources to make some changes)?

Best regards,

mikepoole
Champ in-the-making
Champ in-the-making
Tijs

I don't deploy via the BAR file into Explorer

My deployment is via the code

repositoryService.createDeployment()
  .addClasspathResource("DroolsExample.bpmn20.xml")
  .addClasspathResource("ArticleSize.drl")
  .deploy();

Could this be where the problem lies?

The relevant jar files are all in the explorer paths

Mike

trademak
Star Contributor
Star Contributor
That could be the cause of this yes. Could you try to deploy the BAR via the Explorer?

Thanks,

balu008
Champ in-the-making
Champ in-the-making
Hi,
i m new to activiti explorer and trying to integrate activiti with drool . how to use drl file in activiti diagram?pls help me
thanks in advance…

regards
bala

trademak
Star Contributor
Star Contributor
Hi,

Please take a look at the business rule task example in the Activiti in Action source code you can find here:

https://code.google.com/p/activitiinaction/source/browse/trunk/bpmn-examples/src/test/java/org/bpmnw...

Best regards,

pradnya1
Champ in-the-making
Champ in-the-making
Business Rule Task is marked as Experimental in Activiti 5.13 User Guide. Is this task stable now?

trademak
Star Contributor
Star Contributor
You can consider it as stable from a functionality point of view. We do want to improve the business rule integration at some point in time and then the attributes in the business rule task might change.

Best regards,

valep
Champ in-the-making
Champ in-the-making
I´ve a problem, i do not use the knowledge base, i only include in a very easy example a business task, and i´ve added a rule.
The example is getting a name in a user task, later i make an objet that only contains a boolean and i initialize it in false, and the rule says if objects attribute false then object attribute true. This rule is in a drl and i´m referring to it by its name
I´ve added the jars:
              knowledge-api-5.3
              drools-compiler-5.3.0.Final
              drools-core-5.3.0.Final
              drools-api-5.1.1
              antlr-runtime-3.1.3
              mvel2-2.1.0.drools4
to the explorer, and i´ve modified the activiti-standalone-context.xml.
I´ve deployed de project and the .drl is on the bar.
When in activiti explorer i try to charge the bar, the error "org.drools.util.compositeclassloader.clone()Lorg/drools/util/compositeclassloader;" is on and i can´t continue.
Any help?

jbarrez
Star Contributor
Star Contributor
No idea. This is a Drools issue - probably missing some drools dependency.