use of org.drools.core.rule.DialectRuntimeData in project drools by kiegroup.
the class KieBaseUpdaterImpl method run.
@Override
public void run() {
InternalKnowledgeBuilder kbuilder = ctx.kbuilder;
CompositeKnowledgeBuilder ckbuilder = kbuilder.batch();
boolean shouldRebuild = applyResourceChanges(kbuilder, ckbuilder);
removeResources(kbuilder);
// remove all ObjectTypeNodes for the modified classes
if (ctx.modifyingUsedClass) {
for (Class<?> cls : ctx.modifiedClasses) {
clearInstancesOfModifiedClass(cls);
}
for (InternalKnowledgePackage pkg : ctx.kBase.getPackagesMap().values()) {
DialectRuntimeData mvel = pkg.getDialectRuntimeRegistry().getDialectData("mvel");
if (mvel != null) {
mvel.resetParserConfiguration();
}
}
}
if (shouldRebuild) {
// readd unchanged dsl files to the kbuilder
for (String dslFile : ctx.unchangedResources) {
if (isFileInKBase(ctx.newKM, ctx.newKieBaseModel, dslFile)) {
ctx.newKM.addResourceToCompiler(ckbuilder, ctx.newKieBaseModel, dslFile);
}
}
KieBaseUpdate kieBaseUpdate = createKieBaseUpdate();
ctx.kBase.beforeIncrementalUpdate(kieBaseUpdate);
rebuildAll(kbuilder, ckbuilder);
ctx.kBase.afterIncrementalUpdate(kieBaseUpdate);
}
ctx.kBase.setResolvedReleaseId(ctx.newReleaseId);
for (InternalWorkingMemory wm : ctx.kBase.getWorkingMemories()) {
wm.notifyWaitOnRest();
}
}
Aggregations