From: <jbo...@li...> - 2006-04-26 01:03:45
|
Author: mic...@jb... Date: 2006-04-25 21:03:32 -0400 (Tue, 25 Apr 2006) New Revision: 3963 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml Log: Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml 2006-04-25 23:48:28 UTC (rev 3962) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml 2006-04-26 01:03:32 UTC (rev 3963) @@ -142,7 +142,9 @@ <column object-type="Zaa" /> </or> - <eval expression="1==1" /> + <eval> + 1==1 + </eval> </lhs> <rhs> @@ -171,6 +173,13 @@ can nest things further). "Exists" and "Not" work around Columns, to check for the existence or non existance of a fact meeting its constraints.</para> + + <para>The Eval element allows the execution of a valid snippet of java + code - as long as it evaluates to a boolean (do not end it with a + semi-colon, as it is just a fragment) - this can include calling a + function. The Eval is less efficient then then columns, as the rule engine + has to evaluate it each time, but it is a "catch all" feature for when you + can express what you need to do with Column constraints.</para> </section> <section> @@ -219,10 +228,10 @@ <example> <title>Drools 3 XML equivalent</title> - <programlisting><rule name="my rule"> + <programlisting><rule name="Goodbye Cruel World"> <lhs> <column identifier='goodbye' object-type='String' > - <eval expression='goodbye.equals("Goodbye")'/> + <eval>goodbye.equals("Goodbye")</eval> </lhs> <rhs> goodbyeWorld( goodbye ); |