This is straightforward: You use $param, as usual, in the code snippet, and the list in the cell below:
Data
coverType in ( $param )
"A","B", "C", "D"
"X","Y","Z"
To obtain the actual value from the fact, use a binding variable and refer to this in the action.
Data
$ct: coverType in ( $param )
--------------------
result
add( $ct )
and an 'x' in the cells below, where required.
-W
Hi,I am pocing/learning drools and I am trying to implements Compound Value Restrictions using 'In' in a decision table.I can do this in a rule likerule "CoverType Example"when$risk : Data( coverType in ("A","B", "C", "D"))thenresult.add("CoverType was one of A, B C or D");endI can also implement this in a decision table in a long winded fashionCondition, ActionData, resultcoverType, add("$param")A, CoverType was one of A, B C or DB, CoverType was one of A, B C or DC, CoverType was one of A, B C or DD, CoverType was one of A, B C or DIs there a compact way to do this using a Compound Value Restriction using in?Something like:Condition, ActionData, resultcoverType in, add("$param")"A,B,C,D", CoverType was one of A, B C or DWhat goes in the script part "coverType in"?The number of items in the list can be variable, so don't want to write something that has $1, $2, $3, $4ThanksDavid
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users