if (resource == null) {
throw new IllegalArgumentException("EObject '" + root + "' has a null resource.");
}
ICreateElementsFactory handler = createCreateElementsFactory();
CreateMissingElementsWithDrools ce = provider.getInferenceEngine(handler, false, new IModelReloader() {
@Override
public EObject reload() throws InferenceException {
try {
return loader.loadDirectly(loadClass, logRuleSource);
} catch (Exception e) {
throw new InferenceException(e);
}
}
});
logTimed("infer", "performing inference", "", "");
ce.create(root, logRuleSource, monitor);
// write out this inferred model for reference
logTimed("infer", "writing out inferred model", "", "");
inferredModel = provider.saveInferredModel(resource);