CONDITION |
$c: ConditionObject |
/* $1 */ |
Got Object |
YES |
YES |
YES |
YES |
and that produces ..
when
$c: ConditionObject(/* YES */)
for every rule where there is a "YES". I didn't want to overcomplicate the test for Drools .. i.e. : Object() is sufficient
-== Some other things I found ==-
I found a behaviour about rule generation which was not expected.
a CONDITION can have nothing in the "Object row" (the first row down).. that is good.
and the code in the "code" row, (next row after) will be put in the When .. nice.
ie:
CONDITION
$c : ConditionObject( /* $1 */ )
Description
YES
YES
What is unexpected is that .. these "rules" get reordered such that, if they are at the from (column A) and there is a CONDITION in column B that looks like
CONDITION
$e: FieldObject( ) from $c.field
aField
Description
A
B
the rule will look like
when
$e: FieldObject( aField == "A" ) from $c.field
$c: ConditionObject( /* YES */ )
because it adds each "CONDITION" into a list on a row by row basis; It will add the CONDITION in column B first, before the Condition in Column A because there is no data in Column "A",first cell.
hope that helps someone somewhere
Hi,
Thanks for the response.
That doesn't seem to be right - this is what is produced from the Compiler.
// rule values at A9, header at A3
rule "Test rule_9"
when
$c : ConditionObject(somefield)
$a : ActionObject(this != null == "X")
EmbeddedObject(myField == AnEnum.SomeOtherValue) from $c.embedded
then
ActionObject.someMethod2(50);
$a.someMethod("someOtherValue")
$a.someMethod3(B)
end
Is there a way to have a "when" rule produced where the data table row, for that CONDITION is empty ?
The hack version I can work out is
CONDITION
$a : ActionObject
$param != null
this
this