Home > Back-end >  The drools stateless session implemented according to the specific rule name
The drools stateless session implemented according to the specific rule name

Time:09-23

The drools stateless session implemented according to the specific rule name

CodePudding user response:

Public void fireRules (List ClaimRuleInfoList) {
For (ClaimRuleInfo ClaimRuleInfo: claimRuleInfoList) {
If (ObjectUtils. IsEmpty (claimRuleInfo getRuleCodes ())) {
Logger. The error (" the policy number for [{}] under the policy of no binding audit rules... ", claimRuleInfo. GetClmAppInfoData (.) getGroupNo ());
[{}] logger. The info (" policy implementation rules over. ", claimRuleInfo. GetClmAppInfoData () getGroupNo ());
continue;
}
Logger. The info (" implementation rules start... ");
KieSession KieSession=KieUtils. GetKieContainer (.) newKieSession (" ksession - common - rules ");
FactHandle kieFactHandle=insertFact (kieSession claimRuleInfo);
Int count=kieSession. FireAllRules (new InsuredRuleAgendaFilter (claimRuleInfo. GetRuleCodes ()));
Logger. The info (common rules, the implementation of the "{} rule", count);
KieSession. Delete (kieFactHandle);
KieSession. The dispose ();

}
}

Private FactHandle insertFact (KieSession KieSession, ClaimRuleInfo ClaimRuleInfo) {
Org. Kie. API. The runtime. Rule. FactHandle FactHandle=kieSession. Insert (claimRuleInfo);
KieSession. SetGlobal (" logger, "logger);
KieSession. SetGlobal (" commonServiceI commonServiceI);
KieSession. SetGlobal (" DEATH_RESPONSE_LIST ", Arrays. AsList (get string (" death. The response. The list "). The split () ", "));
KieSession. SetGlobal (" DISABLED_RESPONSE_LIST ", Arrays. AsList (get string (" disabled. The response. The list "). The split () ", "));
KieSession. SetGlobal (" STRICK_RESPONSE_LIST ", Arrays. AsList (get string (" strick. Response. The list "). The split () ", "));
Return factHandle;
}

CodePudding user response:

How to put the state into a stateless now have
  • Related