像Java开发语言一样,Drools文件中也可以添加注释。注释部分Drools引擎是会将其忽略调的。单行注释使用“//”,示例如下:

rule "Testing Comments"
when
    // this is a single line comment
    eval( true ) // this is a comment in the same line of a pattern
then
    // this is a comment inside a semantic code block
end

注意,使用“#”进行注释已经被移除。 多行注释与Java相同,采用“/*注释内容*/”,来进行注释,示例如下:

rule "Test Multi-line Comments"
when
    /* this is a multi-line comment
       in the left hand side of a rule */
    eval( true )
then
    /* and this is a multi-line comment
       in the right hand side of a rule */
end

相关技术视频

QQ技术交流2群:715840230

CSDN学院:《Drools7规则引擎进阶教程》

CSDN学院:《Drools7规则引擎入门教程》

CSDN学院:《Drools7系列优惠套餐》

获得完整的《从Drools规则引擎到风控反洗钱系统》可评论留下邮箱。



drools规则引擎之注释插图

关注公众号:程序新视界,一个让你软实力、硬技术同步提升的平台

除非注明,否则均为程序新视界原创文章,转载必须以链接形式标明本文链接

本文链接:https://www.choupangxia.com/2019/09/06/drools%e8%a7%84%e5%88%99%e5%bc%95%e6%93%8e%e4%b9%8b%e6%b3%a8%e9%87%8a/