not_rule_test.drl

来自「jboss规则引擎」· DRL 代码 · 共 37 行

DRL
37
字号
package org.drools.test;

import org.drools.Cheese;

global java.util.List list;

rule "not rule test"
	salience 10
    when       
        not Cheese( price == 5 )
    then
		list.add( new Integer( 5 ) );
end    

rule "not rule with bound variable"
    when
        not Cheese( $price:price -> ( $price.intValue() == 5 ) )
    then
		list.add( new Integer( 6 ) );
end

rule "not rule with other columns 1"
    when
        Cheese( $type : type == "cheddar" )
        not Cheese( price == 5 )
    then
		list.add( new Integer( 7 ) );
end

rule "not rule with other columns 2"
    when
        not Cheese( price == 5 )
        Cheese( $type : type == "cheddar" )
    then
		list.add( new Integer( 8 ) );
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?