I would rather use a class with an Enumeration representing the conclusion.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of David Boaz
Sent: 25 August 2008 13:09
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Intermediate conclusions using strings
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-tp19141834p1914
1834.html
Sent from the drools - user mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users