MrDrool
unread,Sep 24, 2025, 9:06:44 AM (4 days ago) Sep 24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Drools Usage
Hello,
I have a strange problem with @PropertyReactive.
In reality my Class has 57 attributes(Strings, Booleans, Calendars, Subclasses etc), but for example:
@PropertyReactive
ClassA{
String a;
String b;
}
rule "rule1"
when
classA: ClassA(a == "a")
then
modify(classA){ setB("b")};
end
rule "rule2"
when
classA: ClassA(b == "b")
then
System.out.println("check");
end
My problem is that rule 2 worked as expected as long as I did not change ClassA.
But after I added a new attribute to ClassA Rule 2 stopped firing:
@PropertyReactive
ClassA{
String a;
String b;
ClassB c;
}
I have played around a bit and noticed the following:
- Removing ClassB from ClassA -> rule2 is working again
- Using @ClassReactive instead of @PropertyReactive -> rule2 is working
- Removing another attribute from ClassA and adding ClassB ->rule2 is working
- using retract() and inseart() -> rule2 is working
- Adding another simple attribute like String -> rule2 is not working
- using update() instead of modify -> rule2 is not working
=> with 58 attributes in my class rule2 will stop working with @PropertyReactive. Is this too much? Is the class too complex? Is this a known limitation?
I can't use @ClassReactive because I have a few hundreds rules and I get problems in other rules with endless loops, so I guess I have to stay with retract() and insert()?
I'm still on Drools 7.74.1
Best regards
MrDrool