Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco committed Jul 17, 2023
1 parent 26947f0 commit fedfb3d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public class DefaultKnowledgeHelper implements KnowledgeHelper, Externalizable {
protected ReteEvaluator reteEvaluator;
private StatefulKnowledgeSessionForRHS wrappedEvaluator;

private KnowledgeHelper tmsKnowledgeHelper;

public DefaultKnowledgeHelper() { }

public DefaultKnowledgeHelper(ReteEvaluator reteEvaluator) {
Expand Down Expand Up @@ -161,10 +163,13 @@ private KnowledgeHelper executeOnTMS() {
if (!TruthMaintenanceSystemFactory.present()) {
TruthMaintenanceSystemFactory.throwExceptionForMissingTms();
}
if (tmsKnowledgeHelper != null) {
return tmsKnowledgeHelper;
}
reteEvaluator.enableTMS();
KnowledgeHelper knowledgeHelper = reteEvaluator.createKnowledgeHelper();
knowledgeHelper.setActivation(internalMatch);
return knowledgeHelper;
tmsKnowledgeHelper = reteEvaluator.createKnowledgeHelper();
tmsKnowledgeHelper.setActivation(internalMatch);
return tmsKnowledgeHelper;
}

public void cancelMatch(Match act) {
Expand Down

0 comments on commit fedfb3d

Please sign in to comment.