[rules-users] cross products in excel decision tables

Tom Eugelink tbee at tbee.org
Fri Aug 3 03:55:36 EDT 2012


On 2-8-2012 22:45, lhorton wrote:
> the user guide says "To include a pattern without constraints, you can write
> the pattern in front of the text for another pattern."  So your pattern
> would be something like:
>
>     $a : Application  $p : Passport
>
> then your conditions for Passport and your Actions can reference $a
>

Turns out this is a tad different. The notation above generates errors. So I added "()" to Application, which had the side effect of moving the conditions into those parentheses. After some more experimentation, I ended up with this:

     $p : Passport() $a : Application()

The conditions are inserted into the first parentheses pair. Next adding a CONDITION column on "application" resulted in the following:

     $p : Passport( application == $a ) $a : Application()

However, $a is defined after $p, so $a cannot be referenced in $p yet; $a has to move to the front, but that will put the conditions back in $a. So I tried a little smoke screen to hide the parentheses of $a:

     $a : Application(1==1) $p : Passport()

That worked, but is not very pretty. Maybe it is an idea to use an optional placeholder for where the conditions are to be inserted:

     $a : Application() $p : Passport(<insert_conditions_here>)

Thanks for the boot,

Tom


More information about the rules-users mailing list