use of org.drools.core.spi.GlobalExtractor in project drools by kiegroup.
the class RuleContext method getDeclaration.
Declaration getDeclaration(Variable variable) {
if (variable.isFact()) {
Declaration declaration = innerDeclaration.get(variable);
if (declaration == null) {
declaration = queryDeclaration.get(variable);
}
if (declaration == null) {
Pattern pattern = patterns.get(variable);
declaration = pattern != null ? pattern.getDeclaration() : null;
}
return declaration;
} else {
Global global = ((Global) variable);
ObjectType objectType = builder.getObjectType(global);
InternalReadAccessor globalExtractor = new GlobalExtractor(global.getName(), objectType);
return new Declaration(global.getName(), globalExtractor, new Pattern(0, objectType));
}
}
Aggregations