@PropertyRactive not working with too many attributes

16 views
Skip to first unread message

MrDrool

unread,
Sep 24, 2025, 9:06:44 AM (4 days ago) Sep 24
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

MrDrool

unread,
Sep 24, 2025, 9:38:16 AM (4 days ago) Sep 24
to Drools Usage
- @watch -> not working
- @modifies -> not working

Alex Porcelli

unread,
Sep 24, 2025, 9:44:37 AM (4 days ago) Sep 24
to drools...@googlegroups.com
Please provide a reproducer, so we can better assess.
> --
> You received this message because you are subscribed to the Google Groups "Drools Usage" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/drools-usage/922cf596-0de6-4002-99e9-badea0fcbe62n%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages