rule.rule.drl Maven / Gradle / Ivy
import com.zlyx.easy.drools.domain.RuleContextDomain;
import java.util.Arrays;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @prop message string 结束标记
*/
rule "$rule_name"
when
$ctx: RuleContextDomain();
then
Logger log = LoggerFactory.getLogger("$rule_name");
try {
List list = Arrays.asList("a", "b");
for (int i = 0; i < 6; i++) {
System.out.println("第" + (i + 1) + "次输出 ->" + list.get(i % 2));
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("{}", "$message");
end