⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helloworld.drl

📁 jboss规则引擎
💻 DRL
字号:
package HelloWorld
 
#we don't use the import, as class is fully qualified below 
#import org.drools.integrationtests.helloworld.Message

global java.util.List list;

rule "Hello World"
	when
		$m : org.drools.integrationtests.helloworld.Message(list contains "hello", 
					text:message == "hola", 
					number > 40, 
					birthday > "10-Jul-1974", 
					message matches ".*ho.*",
					list excludes "wax")
	then
	    // putting in a complex consequence, to make sure it picks up the variabels correctly
		if (1==1)  {
			int a = 0;
		}
		try {
			System.out.println("hello world with collections " + $m.getMessage());
	    } catch  ( Exception e ) {
	    
	    } finally {
	        list.add( $m );
	    }
		$m.setFired(true); 
end

⌨️ 快捷键说明

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