1

我正在使用 Drools Engine 并遇到意外的异常。

我不断收到异常:

Caused by: java.lang.NullPointerException
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u46$1878980533.eval0(Rule_When_health_notification_received_determine_system_status$u46$1878980533.java:8)
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u46$1878980533Eval0InvokerGenerated.evaluate(Unknown Source)
at com.validator.controllers.Rule_When_health_notification_received_determine_system_status$u46$1878980533Eval0Invoker.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));

Request 包含一些基本信息供规则使用。

我的规则有的标签是:

   @Type("ITEM")
   @Operation("CHANGE_HEALTH")

知道我做错了什么吗?

4

1 回答 1

2

仅用于将agenda-group要一起执行的规则分组。您知识库中的所有规则仍将在需要时进行评估,无论agenda-group它们属于什么。

希望能帮助到你,

于 2018-07-06T13:58:55.940 回答