Drools 在 Agenda Filter 之外的规则上获取 NullPointerException
Drools gets NullPointerException on rule outside of Agenda Filter
我正在使用 Drools Engine 并遇到意外异常。
我一直收到异常:
Caused by: java.lang.NullPointerException
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u4678980533.eval0(Rule_When_health_notification_received_determine_system_status$u4678980533.java:8)
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u4678980533Eval0InvokerGenerated.evaluate(Unknown Source)
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u4678980533Eval0Invoker.evaluate(Unknown Source)
at org.drools.core.rule.EvalCondition.isAllowed(EvalCondition.java:118) [drools-core-6.3.0.Final.jar:6.3.0.Final]
问题是这条规则不应该在我的 AgendaFilter 中。应该是 运行 的规则是:
FactHandle requestFact = kSession.insert(request);
kSession.fireAllRules(new GenericAgendaFilter(ObjectTypes.GROUP, Operations.ITEM_UPDATE));
请求包含要使用的规则的一些基本信息。
我的规则的标签是:
@Type("ITEM")
@Operation("CHANGE_HEALTH")
知道我做错了什么吗?
agenda-group
仅用于将您希望执行的规则组合在一起。您的知识库中的所有规则仍将在需要时进行评估,无论它们属于什么agenda-group
。
希望对您有所帮助,
我正在使用 Drools Engine 并遇到意外异常。
我一直收到异常:
Caused by: java.lang.NullPointerException
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u4678980533.eval0(Rule_When_health_notification_received_determine_system_status$u4678980533.java:8)
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u4678980533Eval0InvokerGenerated.evaluate(Unknown Source)
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u4678980533Eval0Invoker.evaluate(Unknown Source)
at org.drools.core.rule.EvalCondition.isAllowed(EvalCondition.java:118) [drools-core-6.3.0.Final.jar:6.3.0.Final]
问题是这条规则不应该在我的 AgendaFilter 中。应该是 运行 的规则是:
FactHandle requestFact = kSession.insert(request);
kSession.fireAllRules(new GenericAgendaFilter(ObjectTypes.GROUP, Operations.ITEM_UPDATE));
请求包含要使用的规则的一些基本信息。
我的规则的标签是:
@Type("ITEM")
@Operation("CHANGE_HEALTH")
知道我做错了什么吗?
agenda-group
仅用于将您希望执行的规则组合在一起。您的知识库中的所有规则仍将在需要时进行评估,无论它们属于什么agenda-group
。
希望对您有所帮助,