Bound variables in OR conditional element

12 views
Skip to first unread message

Daniel Johnston

unread,
Jul 20, 2010, 10:12:25 AM7/20/10
to Ruleby
Greetings,

I'm running into problems with non accessible bound variables within
an OR conditional element. Here are my symptoms:

On the left hand side:
Bind a variable in implicit AND conditional element.
Use bound variable for comparison within the OR conditional element
of the same rule.

The rule never fires, so I'm assuming the variable is nil within the
OR element. If I remove the OR element, and only use one of the
conditions as an implicit AND, the rule fires as it should.

I'll whip up a working example and post shortly. I just wanted to
see if this has been addressed before, or if I'm missing a clutch
concept!

rule :please_fix_me,
[MyObject, {m.method => :that}],
OR([OtherObject, m.this == b(:that), m.method == "foo"],
[OtherObject, m.this == b(:that), m.method == "bar"]) do |v|

Cheers,
Daniel




Joe Kutner

unread,
Jul 21, 2010, 2:58:01 PM7/21/10
to Ruleby
Yea, this is a bug.I have created a unit test for it, and I will push
the branch up shortly. I'll update this thread when i have it fixed.


On Jul 20, 9:12 am, Daniel Johnston <danielrossjohns...@gmail.com>
wrote:

Joe Kutner

unread,
Aug 27, 2010, 11:50:54 AM8/27/10
to Ruleby
We still haven't been able to fix this problem. Its quite elusive.
However, in version 0.7 you should find that the rule fires at least
once. It seems that it fails to fire twice when both conditions in
the OR are met.

We'll continue to work on it.
Reply all
Reply to author
Forward
0 new messages