[rules-users] Category Rules - Guvnor

Michael Rhoden mrhoden at franklinamerican.com
Thu Feb 11 20:00:57 EST 2010


The category rule should just extend all child rules in that category.  
If all is working your generated DRL should have "extends" in the  
"tax" (etc) rules.

-Michael

On Feb 11, 2010, at 6:33 PM, Amit Kumar <amitkumar at gmail.com> wrote:

> Hi Folks,
>
> I am looking at the category rules and have a scenario to use it.  
> Goes like this
>
> Person
>    Name  String
>    City     String
>    income  int
>
> I want to categorize the rules in states
>
> -US
>    -- NewYork
>    -- Seatle
>    -- SanFrancisco
>
>
> I have created 3 rules
> rule "people living in NY"
> when
>    Person(city="NewYork"
> then
> end
>
> rule "people living in Seatle"
> when
>    Person(city="Seatle"
> then
> end
>
> rule "people living in SFO"
> when
>    Person(city="SanFrancisco"
> then
> end
>
> I associated the above rules with appropriate categories
>
>
> Then I create tax rules
>
> rule "ny tax" -- category "NewYork"
> when
>    Person()
> then
>   Log .. Tax = 10%
> end
>
> rule "WA tax" -- category "Seatle"
> when
>    Person()
> then
>   Log .. Tax = 20%
> end
>
> rule "ny tax" -- category "NewYork"
> when
>    Person()
> then
>   Log .. Tax = 10%
> end
>
>
>
> When I create a object in test scenario of person type .. then all  
> the rules get executed..  The category rule is not having any effect
>
> Is there any documentation on how this works??
>
> Thanks
> Amit
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list