[rules-users] Intermediate conclusions using strings

David Boaz davidb at dbmotion.com
Mon Aug 25 07:09:27 EDT 2008


Hi all,

I have an idea and I want to get the community feedback.

Many times there are many ways to reach an intermediate conclusion. This
conclusion can be used to derive higher level conclusions or actions.
For example, assuming a credit application has several (or) options to
conclude whether a parson is classified as gold member. Then, other rules
need this information to determine the credit limit for that member. To
note, the Person java class doesn't have a specialized attribute for the
classification. The classification is only an internal means to simplify the
application logic.
To solve that problem, I thought to insert a string conclusion to the WM.
Something like:

rule "gold member if revenue per month > 1000" 
  when ...  
  then insert("gold member")
end

rule "gold member if total amount > 1000000"
  when ...
  then insert("gold member")
end
...
rule r100
  when String(value=="gold member")
  then...
end

* Is it an appropriate approach?
* I know it ugly to use the same string literal in various rules. Can we
avoid that?
* Is there a known mechanism to handle these cases?

Thanks, David
-- 
View this message in context: http://www.nabble.com/Intermediate-conclusions-using-strings-tp19141834p19141834.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list