diff -r 87cfa131b535 -r e7e0ae78773e configurationengine/source/plugins/common/ConeLegacyRulePlugin/legacyruleplugin/xsd/ruleml2.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configurationengine/source/plugins/common/ConeLegacyRulePlugin/legacyruleplugin/xsd/ruleml2.xsd Tue Aug 10 14:29:28 2010 +0300 @@ -0,0 +1,86 @@ + + + + + + + RuleML v2 implementation for specifying rules to execute. + + + + + + + + The rule element specifies a single rule to execute.


+ +

+ For example:
+ <rule>MyFeature.MySetting1 == 'test' configures MyFeature.MySetting2 = '1'</rule>
+ This would cause the value '1' to be assigned to the setting 'MyFeature.MySetting2' + if the value of the setting 'MyFeature.MySetting1' is 'test'. +


+ +

+ Arbitrary Python code can also be executed in the rule by enclosing the eval block + with {% %}. For example:
+ <rule>True configures MyFeature.MySetting = {% get_some_value() %}</rule>
+ This would cause the value got from evaluating the Python function call + get_some_value() to be assigned to the setting 'MyFeature.MySetting'. +


+ +

+ Any settings referenced inside an eval block must be enclosed with ${ } + to differentiate them from the Python code. For example:
+ <rule>True configures MyFeature.MySetting = {% get_some_value(${MyFeature.MySetting1}) %}</rule>
+ This would cause the value of the setting 'MyFeature.MySetting1' to be passed as a + parameter to the function call. + The actual feature object handled by ConE can be accessed by enclosing the setting + reference with @{ }. +


+ +

+ Any functions or variables (like get_some_value() in the above examples) need + to be defined using eval_globals elements inside the ruleml element. +

+ ]]> +
+
+
+ + + + An eval_globals block can be used to add Python variables + or functions to the evaluation context of the rules contained + within the current ruleml implementation. The Python code can be contained + either directly inside the XML element or inside a file pointed by the + 'file' attribute. + + + +
+
+
+ + + + + + + + Path to the file containing the Python code of the eval_globals element. + Should be a path relative to the current implementation file. + Specifying the 'file' attribute causes the text content of the eval_globals + element to be ignored. + + + + + + +
\ No newline at end of file