DROOLS syntax details

①package com.sample //Package name, can not conflict
with keywords function String hello(String name) { return "Hello "+name+"!"; } ⑤rule "myRule" no-loop true //After executing once, can it be activated again salience 100 //Priority ⑥when m : Message( status == Message.HELLO, message : message ) ⑦then m.setMessage( "Goodbye cruel world" ); m.setStatus( Message.GOODBYE ); update( m ); myGlobalList.add( "Hello World" );//Use global Variable System.out.println( hello( "Bob" ) );//Call the definition function End

















 

The rule name can take any name under "".
Property List:
Property Type Default Value Description
no-loop Boolean false Setting no-loop to true can prevent the rule from being activated again.
salience integer 0 Rules with higher priority numbers will be executed before rules with lower priority numbers.
agenda-group String MAIN Only rules in the agenda group with focus will fire.
auto-focus Boolean false If the rule meets the activation conditions, the agenda-group where the rule is located automatically gets the focus, allowing the rule to fire.
activation-group String N/A Rules in the activation-group of the same name will activate in a mutually exclusive manner
dialect String "java" or "mvel" Specifies the language used in LHS code expressions or RHS code blocks.
date-effective String, containing the date/time definition N/A The rule can only be activated after the date and time specified by date-effective.
date-expires String, containing the date/time definition N/A If the current time is after the time specified by date-expires, the rule cannot be activated.
duration long N/A Indicates that the rule will fire after a specified period of time, if the rule's activation condition is still true at that time.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326943494&siteId=291194637