【发布时间】:2015-08-21 21:12:59
【问题描述】:
这是我的规则
rule "ICodes in HISTORY"
@filename("ORDERING.drl")
ruleflow-group "ORDERING_MAIN"
lock-on-active true
salience 5000
when
icodeColl: ArrayList (size > 0) from collect ( CodeFact( traceSegments contains RuleConstant.Seg.H, position == null, type == RuleConstant.CodeSource.I) )
ccodeColl: ArrayList (size >= 0) from collect ( CodeFact( type == RuleConstant.CodeSource.C) )
orderHier: OrderHierarchy( identifier ==
RuleConstant.ReferenceTables.IHIER)
theCase: CaseFact()
then
ArrayList hOrderedIcodes= orderHier.order(icodeColl, ccodeColl);
for (int i=0; i<hOrderedIcodes.size(); i++) {
CodeFact icode = (CodeFact)hOrderedIcodes.get(i);
int positionCount = theCase.getPositionCount();
icode.setPosition( BigInteger.valueOf( positionCount ) );
theCase.incrementPosition();
update( icode);
}
end
这是我得到的错误。我知道 CodeFact 在另一条规则中被撤回,但这对我来说太疯狂了,我会在 when 子句中吞噬它,但在 then 子句中它不可用于更新。
org.drools.FactException:更新错误:找不到对象的句柄: CodeFact@2a501b38 {xxx.xxx, 1, 1.0}。 它在工作记忆中吗?
【问题讨论】:
-
可能是一个错误。创建一整套重现问题所需的 Java 和 DRL 文件,并将其全部添加到您的问题中,并确保提及 Drools 版本。
标签: drools