cancel
Showing results for 
Search instead for 
Did you mean: 

rule task is not invoked sometimes .

sapra
Champ in-the-making
Champ in-the-making
I have a simple process.
service task –> business task : my business task executes.
I added a mail task in between;
service task –> mail task –> business task : I see that mail is working but business task does not work ..

the business task operates on one object which is inserted by the first service task ; like ;
execution.setVariable("user", u1);

apart from the insertion of the mail task there is no other change. Why does not the business task run ?

which class in the activiti engine can I debug to see which next task is being picked up for execution ?

thanks
sapra
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Hi,

Didn't you see some error message appearing in the log?
Are you running the business process from a unit test or from the Activiti Explorer?

Best regards,

sapra
Champ in-the-making
Champ in-the-making
After adding the logging.properties to my classpath , I see the log messages now.
And, it appears that the engine picked up the business rule task. my drl file is like this :

package com.x.workflow
import com.x.api.dto.User;
1 rule "validate_user"
2 when
3     System.out.println("executing the rule");
4  user : User(getName().equals("test123") == false)
5 then
6     user.setDescription("changed in workflow");
7  System.out.println("user is not test123");
8  end

I am basically trying to see if I can access the methods of my class from the rule file.
But I don't see the print statements or the effect of the setter call in line 6.

where should I step in my debugger to see if the rule is being executed and what process data is available for the rule .

trademak
Star Contributor
Star Contributor
Hi,

I don't think line 4 is valid, but it's good to write a simple unit test with only Drools logic.

Best regards,