[rules-users] [Drools.5.0.1] insertLogical abnormalities
Stathis Rouvas
stathis.rouvas at eurodyn.com
Tue Apr 24 13:43:46 EDT 2012
Hi List.
I am using Drools.5.0.1.
I am experiencing abnormalities using insertLogical(),
namely that in the following code
RaResultCode and RegistryUsed are found inserted (using the relevant queries), while
InternalResultCode is not found (using the query "get ircQuery")
and I cannot explain why this is hapenning.
The code in question is:
query "get RaCode"
rrc : RaResultCode()
end
query "get RaRegUsed"
regUsed : RegistryUsed()
end
query "get ircQuery"
irc : InternalResultCode()
end
rule "r5"
no-loop true
dialect "mvel"
when
gnId : GoodNumbers()
not ( logg : InternalResultCode( ruleId=="5", goodNo==gnId.goodNo) )
LogicalValue : HeaderMessage( gnId.goodNo==goodNo , totalItemNo == 3 )
v261 : t2206( )
then
InternalResultCode irrc = new InternalResultCode();
irrc.setRuleId("5");
irrc.setGoodNo(gnId.goodNo);
insertLogical(irrc);
RaResultCode rrc = new RaResultCode();
rrc.setResultRuleId("5");
rrc.setResultGoodNo(gnId.goodNo);
insertLogical(rrc);
RegistryUsed ruv261 = new RegistryUsed();
ruv261.setResultGoodNo(gnId.goodNo);
ruv261.setRegRowId(v261.regRowId);
ruv261.setVersionId(v261.versionId);
ruv261.setRuleId("5");
insertLogical(ruv261);
end
Using a statefull session,
the KnowledgeBase is created,
then 26 facts for "t2206" and one fact for "HeaderMessage" are inserted and finally
fireAllRules() is called.
Afterwards the defined queries are used to gather the results, but as noted in the begininning
results for "InternalResultCode", are missing.
There should be one for each of the "InternalResultCode", "RaResultCode" and "RegistryUsed" entities.
Can anyone shed some light?
Thank you for your time,
-Stathis
More information about the rules-users
mailing list