Drools RuleTable and @Watch

36 views
Skip to first unread message

Andre Kapp

unread,
Sep 29, 2021, 6:02:16 PM9/29/21
to Drools Usage

I have a requirement to configure @Watch for some of my rules defined in the RuleTable in Excel. However, cannot find any documentation or example on how to get this right.
I have now tried any possible combination of options, but they all turn out to be wrong.
My target drl file I', aiming for should look like this:
```
rule "TestWatch One"
  no-loop
    when
        $payCommResponseDTO: PaymentCommissionResponseDTO(commissionStructure == CommissionStructure.ADJUSTED) @Watch(commissionStructure)
    then
        System.out.println("watch one");
end
```

Current RuleSet/RuleTable looks like this:
Screenshot 2021-09-29 at 23.11.14.png
Any pointer will be greatly appreciated!!


Toshiya Kobayashi

unread,
Nov 2, 2021, 4:16:20 AM11/2/21
to Drools Usage
Hi,

You can add @watch(XXX) right after the CONDITION pattern fact class name.


It's also documented here.

```
You can terminate the pattern with @watch annotation, which is used to customize the properties that the pattern is reactive on.
```

Cheers,
Toshiya


2021年9月30日木曜日 7:02:16 UTC+9 kap...@gmail.com:
watch-spreadsheet.png

Andre Kapp

unread,
Nov 2, 2021, 4:20:33 AM11/2/21
to drools...@googlegroups.com
Thank you very much!!!!

Really appreciate.

Andre

--
You received this message because you are subscribed to a topic in the Google Groups "Drools Usage" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/drools-usage/ibIjHCwY4KU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/3b354436-7e5c-4a20-9ec3-9863de634507n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages