hardikisc opened a new issue, #6264:
URL: https://github.com/apache/incubator-kie-drools/issues/6264
Hi,
Step -1 We are creating kieSession using below code:
`final Resource resource = ResourceFactory.newFileResource(drlFile);`
`final KnowledgeBuilderConfiguration kConfig =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();`
`kConfig.setOption(PropertySpecificOption.DISABLED);`
`final KnowledgeBuilder kBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(kConfig);`
`kBuilder.add(resource, ResourceType.DRL);`
`kbase=kBuilder.newKieBase();`
`KieSession ksession=kbase.newKieSession();`
Step -2 We fire all the rules using fireAllRules Method like so:
`int thisIterNumRulesFired = ksession.fireAllRules();`
Step -3 Then after firing all the rule we are retract all the facts from
working memory like so:
`Collection<FactHandle> factHandles = ksession.getFactHandles();`
`List<FactHandle> handlesToRetract = new ArrayList<>(factHandles);`
`for (FactHandle handle : handlesToRetract) {`
` ksession.retract(handle);`
`}`
Step -4 After this, We are logging how many object remain in drools working
memory:
log.info("After deleted: " + ksession.getObjects().stream().toList());
Then we are repeating steps from step 2 to 4 again and again.
This log always return no facts.
We have declared fact in drl file this is the fact declaration:
declare GtiAssetMessageData
id: String
prefix : String
suffix : String
domesticAssetTy : String
common : String
countryOfTax : Integer
countryOfTaxSub : Boolean
active : Integer
z2 : Integer
z2Sub : Boolean
lu : Integer
luSub : Boolean
issdCapInd : String
interestFreqDayNoTranslated : int
usualPayDates : String
shortDesc : String
longDesc : String
cntryQuote : String
assetIdTy : String
assetId : String
relatedInd : String
relatedAssets : String
earliestNotificationDt : Integer
end
We have rule which creates inserts this fact in drools working memory
// rule values at B39, header at B22
rule "Initialize > Default"
no-loop true
when
state : State(current == "Initialize3")
RuleSet(simulatedSequentialSalience == -14)
then
GtiAssetMessageData gamd = new GtiAssetMessageData();
gamd.setId(decisionTableHelper.getRandomId());
gamd.setCommon("");
gamd.setActive(0);
gamd.setCountryOfTax(0);
gamd.setZ2(0);
gamd.setLu(0);
gamd.setIssdCapInd(" ");
gamd.setUsualPayDates("");
gamd.setShortDesc("");
gamd.setLongDesc("");
gamd.setCountryOfTaxSub(false);
gamd.setLuSub(false);
gamd.setZ2Sub(false);
gamd.setRelatedInd("");
gamd.setRelatedAssets("");
insert(gamd);
decisionTableHelper.log("\nInitialize > Default fired - inserted
GtiAssetMessageData with id:"+gamd.getId());
state.setCurrent ("save AssetId");
update (state);
end
This fact always remains in working even though we delete all the facts from
working memory.
We are facing this issue in drools version 7.60.0.Final, 7.61.0.Final,
7.62.0.Final with java 17 and java 21. But these drools version work fine with
java 11
I have attached all the drools version compatibility testing result in
below attached excel
[drools_java_version_compatibility.xlsx](https://github.com/user-attachments/files/18968850/drools_java_version_compatibility.xlsx)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]