[rules-users] Question about the Nature of Ruleflows

BenjaminWolfe benjamin.e.wolfe at gmail.com
Mon Aug 20 20:19:01 EDT 2012


I'm trying to wrap my mind around the nature of ruleflows -- and I think this
question sums up a bit of my confusion.

I have a stateful knowledge session.  The stateful knowledge session has a
ruleflow associated with it.  That ruleflow diverges into two branches --
branch A and branch B -- based on a rule constraint.  It's an XOR, and the
mvel rule constraints are something like this:

to branch A
$u : User( $i : userId )
exists ( Dog( owner == $i, hasDogTag == false) )

to branch B
$u : User( $i : userId )
not ( Dog( owner == $i, hasDogTag == false) )

Then the two branches converge again.  I insert two facts: user 1, whose
dogs all have dog tags, and user 2 whose third dog is missing a tag.  Then,
after I insert both facts, I fire all rules.

Should the flow be like this?

user 1: start --> diverge --> branch A (tell him to buy dog tags) -->
converge --> end
user 2: start --> diverge --> branch B (leave him alone) --> converge -->
end

Or does a ruleflow look at the whole session rather than each fact -- in
which case either both users would pass through branch A, or both would pass
through branch B?

If I want the first case to happen, is there something I'm missing in the
implementation?  And are there any more details I can add to make my post
more specific?  Thank you for your help.



--
View this message in context: http://drools.46999.n3.nabble.com/Question-about-the-Nature-of-Ruleflows-tp4019292.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list