[rules-users] Category Rules - Guvnor

Amit Kumar amitkumar at gmail.com
Thu Feb 11 19:31:21 EST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100211/0766e72f/attachment.html 


More information about the rules-users mailing list