thisthisCONDITION$param != null
$a : ActionObject
XXthis != nullAdd an additional CONDITION for ActionObject.CONDITION
You'll need to probably add a constraint for "this != null" and put an X in the rows; e.g.
$a : ActionObject
_______________________________________________On 22 May 2013 09:55, Ramon Buckland <ramon@thebuckland.com> wrote:
Hi.I am working on Drools 5.5.0.Final and have a question regarding XLS and a Decision Table structure,I have a ConditionObject and an ActionObject and wanted to know or see an example for XLS that produces a "does exist" for the ActionObjectin the when.I can simply write the rule in a DRL, but translating how to make the XLS compiler create the same is proving challenging.An example:I want to produce a set of rules like belowrule "Test rule_11"when$c : ConditionObject( somefield )EmbeddedObject(myField == AnEnum.SomeValue) from $c.embedded$a : ActionObject( )then$a.someMethod("value")$a.someMethod2(10)$a.someMethod3("A")endrule "Test rule_12"// some other AnEnum checks.What I can't work out is how I get the test of "existence" of the Action Object into the "when" for the rule, so that I can "use" the Object in the ACTION.In addition, is there a away that I can avoid needing a whole column just for "existence of an object with a field.. collect as a variable $c : (ConditionObject( somefield )" ?CONDITION CONDITION ACTION ACTION ACTION$c : ConditionObject EmbeddedObject() from $c.embedded$param myField == AnEnum.$param $a.someMethod("$param") $a.someMethod2($param) $a.someMethod3($param)"Description" "Description" "Description" "Description" "Description"somefield SomeValue value 10 Asomefield SomeOtherValue someOtherValue 50 BThis is the XLS of the above.When this sheet is compiled, I get the following: How do I setup a "condition" for ActionObject to get in the when ?package packageName;//generated from Decision Table// rule values at A8, header at A3rule "Test rule_8"when$c : ConditionObject(somefield)EmbeddedObject(myField == AnEnum.SomeValue) from $c.embeddedthen$a.someMethod("value")$a.someMethod2(10)$a.someMethod3(A)end// rule values at A9, header at A3rule "Test rule_9"when$c : ConditionObject(somefield)EmbeddedObject(myField == AnEnum.SomeOtherValue) from $c.embeddedthen$a.someMethod("someOtherValue")$a.someMethod2(50)$a.someMethod3(B)endRamon Buckland
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users