Drools 6.0.1 中是否有等效的方法 WorkingMemory.assertObject?
Is there an equivalent of method WorkingMemory.assertObject in Drools 6.0.1?
我正在尝试将我的应用程序从 Drools 2.0 升级到 6.0.1。在我的代码中,我有类似的东西:
workingMem.assertObject(fact);
问题是 WorkingMemory 中不再有 assertObject 方法 class。
根据 this website,此方法可以做到这一点:
"Objects are asserted into the WorkingMemory, which allows the rule-engine to be aware of its existence, and a fact handle is returned as a reference. Once asserted, the fact may be used to satisfy some portion of any rule's activation condition."
我在 Drools 6.0.1 中找不到任何等效项。有什么办法可以解决这个问题吗?
您会在接口 org.kie.api.runtime.rule.EntryPoint
:
中找到方法 - 由于与 assert 的明显冲突而重命名为 insert
FactHandle insert(Object object)
Inserts a new fact into this entry point
Parameters:
object - the fact to be inserted
Returns:
the fact handle created for the given fact
EntryPoint 扩展到接口 KieSession
,它是事实存储和引擎激活的枢轴对象。
我正在尝试将我的应用程序从 Drools 2.0 升级到 6.0.1。在我的代码中,我有类似的东西:
workingMem.assertObject(fact);
问题是 WorkingMemory 中不再有 assertObject 方法 class。
根据 this website,此方法可以做到这一点:
"Objects are asserted into the WorkingMemory, which allows the rule-engine to be aware of its existence, and a fact handle is returned as a reference. Once asserted, the fact may be used to satisfy some portion of any rule's activation condition."
我在 Drools 6.0.1 中找不到任何等效项。有什么办法可以解决这个问题吗?
您会在接口 org.kie.api.runtime.rule.EntryPoint
:
FactHandle insert(Object object)
Inserts a new fact into this entry point
Parameters:
object - the fact to be inserted
Returns:
the fact handle created for the given fact
EntryPoint 扩展到接口 KieSession
,它是事实存储和引擎激活的枢轴对象。