[rules-users] Identify Rule on Attributes

Wolfgang Laun wolfgang.laun at gmail.com
Mon Mar 16 06:04:53 EDT 2009


On Mon, Mar 16, 2009 at 6:24 AM, Nikhil_dev <k.nikhil at verchaska.com> wrote:

>
> As you guys have suggested to combine all the rule base into one then for
> example(one which i have already mentioned)
> i will combine Rule1 , rule 2 and rule3 into 1 rule base then, when i pass
> the variables to the rulebase who will i come to know which rules were
> executed.
>

Knowing (as you say) about the execution of rules may be used by the
system you build in several ways. In any case, the right hand side of a
rule (after the "when" keyword) is the place to program the actions
that preserve the knowledge that this rule has fired. If nothing is done
on the right hand side, then the effect of the execution of a rule is
indeed lost.

The most important ways of making use of the firing of a rule are:

(1) To assert a (new) fact into the Working Memory. This is done if
one expects these new facts to combine with each other or the original
facts in more rule firings.

(2) To modify an existing fact that has been found (matched) by
the rule. This may, in turn, fire other rules.

(3) To make use of some application service to inform the user
of your system that the system has concluded a result. A very
simple way would be to print a message on the terminal; a more
sophisticated way might be to send a message; etc.

Certainly any combination of these basic techniques is to be
considered as well.

You have, so far, shown us examples of very simple rules; it is
not clear to me what the purpose of this system will ultimately be.
Therefore, I cannot advise you about what is best in your case.


> things i would like to know if i am going to execute this idea, the number
> of rules that i will using say around 100000, is it advisable to include
> all
> of them in to 1 rulebase!!!
> will there be any performance issues.
>

Performance is not only a question of the number of rules; it is also
a question of the quality of the conditions, the number of patterns and
the number of facts that are asserted.

100000 rules is certainly a big number. Memory consumption will
be high. Loading facts and firing depends on the way patterns are
written, and how many facts you'll have in a session. But for me
the main point is how you'll manage to produce this many rules.
Even if you manage to think up, write and test one rule per minute
then this would take 1666 hours or about 10 months of work!
Moreover, you'll have to make sure that this set of rules is consistent
in their combination, e.g., that it doesn't miss a combination of facts
that it should react upon.

To build a good rule based system isn't easier than building any other
complex software system; perhaps it is even more difficult. There are
some good books around that describe the designs that might be applied
with such systems; some of them are referenced on this page:
http://www.jboss.org/drools/documentation.html

-W


>
>
>
> Anstis, Michael (M.) wrote:
> >
> > Furthermore a rulebase can contain rules from many resources (e.g.
> > DRL's).
> >
> > So I guess the cause of your pain is why do you need multiple
> > rulebases!??!
> >
> > -----Original Message-----
> > From: rules-users-bounces at lists.jboss.org
> > [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Scott Reed
> > Sent: 13 March 2009 14:41
> > To: Rules Users List
> > Subject: Re: [rules-users] Identify Rule on Attributes
> >
> > A RuleBase can contain many rules, not just one. Generally we take all
> > the rules we need for an application and we assemble them into one
> > rulebase, so we don't have to figure out which rulebase to use. Does
> > that help?
> >
> > Nikhil_dev [3/13/2009 8:16 AM] wrote:
> >> Perfect this is the situation but the only difference is the last
> > part,
> >>
> >> Rulebase for all the 3 Rules are stored in memory.
> >>
> >> Now i have is attributes(implemented as bean class), but the issue is
> > i dont
> >> know which Rulebase to use out of the three which is present in the
> > memory,
> >> fetching them one by one and executing it individually is possible but
> > a
> >> long procedure which i want to avoid.(executing 3 Rule is ok what if i
> > have
> >> 100000 rules it will be very slow process)
> >>
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> -----
> Regards,
> :working:Nikhil
> --
> View this message in context:
> http://www.nabble.com/Identify-Rule-on-Attributes-tp22471473p22532090.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090316/457d5ed1/attachment.html 


More information about the rules-users mailing list