Dobromir,

Now that problem is more interesting, not silly.

This question goes to the core of the why rules engines are cool.

But, I am afraid that since DROOLS does not have a priority scheme
there is no way to ensure which of the rules in your set will run first.
So, one of the rules will suceed and the others fail because the object
's' has been retracted in the rule that ran.

The solution is in conflict resolution with a priority scheme.  Which
I am not sure is in DROOLS.


SaS




---- On Mon, 14 Jan 2002, Dobromir Karamelsky ([EMAIL PROTECTED]) wrote:

> First of all sorry for this silly Subject I wrote. 
> 
> Thanks for the reply Stuart. The problem is that I need let’s say
> number of s.equalsIgnoreCase("") and one anything_else rule if nothing
> is matched. This anything_else rule have to contain all these N cases
> denied in the <when> clause. Otherwise drools reply twice, 1st the
> reply for the correct match and 2nd the default “I don’t know” message.
> I’m doing retractObject() but it doesn’t help. 
> 
> dobromir
> 
> --- Stuart Schmukler <[EMAIL PROTECTED]> wrote:
> > Dobromir,
> > 
> > I think that the best way to construct rule2 would
> > be:
> > 
> > <rule name="rule2">
> >    <param type="String">s</param>
> >      <when>
> >        <cond>( ! s.equalsIgnoreCase("dobromir") )</cond>
> >      </when>
> >      <then>
> >         pr.println("Don't know what to say!");
> >         retractObject( s );
> >      </then>
> > </rule> 
> > 
> > The idea is to contruct conditions that the engine can
> > see are the same or nearly the same to create a RETE network
> > that evaluates terms of conditions the minimum number of times.
> > 
> > I am not sure the the DROOL engine is up to the task.
> > 
> > 
> > Stuart 
> > 
> > 
> > 
> > 
> > ---- On Mon, 14 Jan 2002, Dobromir Karamelsky ([EMAIL PROTECTED])
> > wrote:
> > 
> > > Is there any way to have a set of rules like this one:
> > > 
> > > <rule name="rule1">
> > >   <param type="String">s</param>
> > >     <when>
> > >       <cond>s.equalsIgnoreCase("dobromir")</cond>
> > >     </when>
> > >     <then>
> > >       pr.println("Hi dobromir");
> > >       retractObject( s );
> > >     </then>
> > > </rule>
> > > 
> > > <rule name="rule2">
> > >   <param type="String">s</param>
> > >     <when>
> > >       <cond> s_not_match_rule1 </cond>
> > >     </when>
> > >     <then>
> > >        pr.println("Don't know what to say!");
> > >        retractObject( s );
> > >     </then>
> > > </rule>
> > > 
> > > I mean how I can use rule names in <when></when> part of rule
> > > definition? Is it possible or I didn't understand the whole
> > rule/facts
> > > concept?
> > > 
> > > 
> > > __________________________________________________


_______________________________________________
drools-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/drools-interest

Reply via email to