此内容没有您所选择的语言版本。
19.6. HelloWorld Example: Rule "Hello World"
- The LHS (after
when) section of the rule states that it will be activated for eachMessageobject inserted into the Working Memory whose status isMessage.HELLO. - Two variable bindings are created: the variable
messageis bound to themessageattribute and the variablemis bound to the matchedMessageobject itself. - The RHS (after
then) or consequence part of the rule is written using the MVEL expression language, as declared by the rule's attributedialect. - After printing the content of the bound variable
messagetoSystem.out, the rule changes the values of themessageandstatusattributes of theMessageobject bound tom. - MVEL's
modifystatement allows you to apply a block of assignments in one statement, with the engine being automatically notified of the changes at the end of the block.