Search in sources :

Example 26 with RuleBuildContext

use of org.drools.compiler.rule.builder.RuleBuildContext in project drools by kiegroup.

the class KnowledgeBuilderImpl method compileRulesLevel.

private void compileRulesLevel(PackageDescr packageDescr, PackageRegistry pkgRegistry, List<RuleDescr> rules) {
    boolean parallelRulesBuild = this.kBase == null && parallelRulesBuildThreshold != -1 && rules.size() > parallelRulesBuildThreshold;
    if (parallelRulesBuild) {
        Map<String, RuleBuildContext> ruleCxts = new ConcurrentHashMap<>();
        try {
            ForkJoinPoolHolder.COMPILER_POOL.submit(() -> rules.stream().parallel().filter(ruleDescr -> filterAccepts(ResourceChange.Type.RULE, ruleDescr.getNamespace(), ruleDescr.getName())).forEach(ruleDescr -> {
                initRuleDescr(packageDescr, pkgRegistry, ruleDescr);
                RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr);
                ruleCxts.put(ruleDescr.getName(), context);
                List<? extends KnowledgeBuilderResult> results = addRule(context);
                if (!results.isEmpty()) {
                    synchronized (this.results) {
                        this.results.addAll(results);
                    }
                }
            })).get();
        } catch (InterruptedException | ExecutionException e) {
            throw new RuntimeException("Rules compilation failed or interrupted", e);
        }
        for (RuleDescr ruleDescr : rules) {
            RuleBuildContext context = ruleCxts.get(ruleDescr.getName());
            if (context != null) {
                pkgRegistry.getPackage().addRule(context.getRule());
            }
        }
    } else {
        for (RuleDescr ruleDescr : rules) {
            if (filterAccepts(ResourceChange.Type.RULE, ruleDescr.getNamespace(), ruleDescr.getName())) {
                initRuleDescr(packageDescr, pkgRegistry, ruleDescr);
                RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr);
                this.results.addAll(addRule(context));
                pkgRegistry.getPackage().addRule(context.getRule());
            }
        }
    }
}
Also used : Arrays(java.util.Arrays) FunctionDescr(org.drools.drl.ast.descr.FunctionDescr) DescrBuildError(org.drools.compiler.compiler.DescrBuildError) RuleBuildContext.descrToRule(org.drools.compiler.rule.builder.RuleBuildContext.descrToRule) AbstractClassTypeDeclarationDescr(org.drools.drl.ast.descr.AbstractClassTypeDeclarationDescr) DroolsParserException(org.drools.drl.parser.DroolsParserException) CoreComponentFactory(org.drools.core.reteoo.CoreComponentFactory) DroolsWarningWrapper(org.drools.compiler.compiler.DroolsWarningWrapper) AccumulateFunction(org.kie.api.runtime.rule.AccumulateFunction) DuplicateRule(org.drools.compiler.compiler.DuplicateRule) Map(java.util.Map) DuplicateFunction(org.drools.compiler.compiler.DuplicateFunction) GlobalDescr(org.drools.drl.ast.descr.GlobalDescr) GuidedRuleTemplateProvider(org.drools.drl.extensions.GuidedRuleTemplateProvider) KnowledgeBaseImpl.registerFunctionClassAndInnerClasses(org.drools.core.impl.KnowledgeBaseImpl.registerFunctionClassAndInnerClasses) XmlPackageReader(org.drools.compiler.compiler.xml.XmlPackageReader) Set(java.util.Set) DefaultExpander(org.drools.drl.parser.lang.dsl.DefaultExpander) KieAssemblers(org.kie.api.internal.assembler.KieAssemblers) Reader(java.io.Reader) DialectError(org.drools.compiler.rule.builder.dialect.DialectError) EntryPointDeclarationDescr(org.drools.drl.ast.descr.EntryPointDeclarationDescr) InvocationTargetException(java.lang.reflect.InvocationTargetException) ResourceConfiguration(org.kie.api.io.ResourceConfiguration) UncheckedIOException(java.io.UncheckedIOException) DialectCompiletimeRegistry(org.drools.compiler.compiler.DialectCompiletimeRegistry) DroolsWarning(org.drools.compiler.compiler.DroolsWarning) RuleImpl(org.drools.core.definitions.rule.impl.RuleImpl) BuildContext(org.drools.compiler.kie.builder.impl.BuildContext) AccessController(java.security.AccessController) BaseResource(org.drools.core.io.impl.BaseResource) DescrResource(org.drools.core.io.impl.DescrResource) DSLTokenizedMappingFile(org.drools.drl.parser.lang.dsl.DSLTokenizedMappingFile) RuleDescr(org.drools.drl.ast.descr.RuleDescr) ObjectType(org.drools.core.spi.ObjectType) ChangeSet(org.kie.internal.ChangeSet) ResourceType(org.kie.api.io.ResourceType) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) ConfigurableSeverityResult(org.drools.compiler.compiler.ConfigurableSeverityResult) XmlChangeSetReader(org.drools.core.xml.XmlChangeSetReader) DrlParser(org.drools.drl.parser.DrlParser) PackageBuilderResults(org.drools.compiler.compiler.PackageBuilderResults) DecisionTableConfigurationImpl(org.drools.core.builder.conf.impl.DecisionTableConfigurationImpl) InternalKnowledgeBase(org.drools.kiesession.rulebase.InternalKnowledgeBase) ImportDeclaration(org.drools.core.rule.ImportDeclaration) PackageDescr(org.drools.drl.ast.descr.PackageDescr) IOException(java.io.IOException) StringUtils.ucFirst(org.drools.core.util.StringUtils.ucFirst) File(java.io.File) WindowDeclaration(org.drools.core.rule.WindowDeclaration) KnowledgeBaseFactory(org.drools.kiesession.rulebase.KnowledgeBaseFactory) ExecutionException(java.util.concurrent.ExecutionException) Dialect(org.drools.compiler.compiler.Dialect) StringReader(java.io.StringReader) ClassPathResource(org.drools.core.io.impl.ClassPathResource) ForkJoinPool(java.util.concurrent.ForkJoinPool) KnowledgeBuilderErrors(org.kie.internal.builder.KnowledgeBuilderErrors) DroolsErrorWrapper(org.drools.compiler.compiler.DroolsErrorWrapper) ProcessBuilder(org.drools.compiler.compiler.ProcessBuilder) Array(java.lang.reflect.Array) ResourceChange(org.kie.internal.builder.ResourceChange) AnnotationDescr(org.drools.drl.ast.descr.AnnotationDescr) KnowledgeBuilderError(org.kie.internal.builder.KnowledgeBuilderError) Function(org.drools.core.rule.Function) TypeDeclaration(org.drools.core.rule.TypeDeclaration) CompositeKnowledgeBuilder(org.kie.internal.builder.CompositeKnowledgeBuilder) TypeResolver(org.drools.core.addon.TypeResolver) AnnotatedBaseDescr(org.drools.drl.ast.descr.AnnotatedBaseDescr) ResourceWithConfiguration(org.kie.api.io.ResourceWithConfiguration) LoggerFactory(org.slf4j.LoggerFactory) PatternDescr(org.drools.drl.ast.descr.PatternDescr) DecisionTableConfiguration(org.kie.internal.builder.DecisionTableConfiguration) AttributeDescr(org.drools.drl.ast.descr.AttributeDescr) DecisionTableFactory(org.drools.drl.extensions.DecisionTableFactory) ReleaseId(org.kie.api.builder.ReleaseId) ImportDescr(org.drools.drl.ast.descr.ImportDescr) StringUtils.isEmpty(org.drools.core.util.StringUtils.isEmpty) RuleBaseFactory(org.drools.core.impl.RuleBaseFactory) ResourceConversionResult(org.drools.drl.extensions.ResourceConversionResult) Method(java.lang.reflect.Method) MissingImplementationException(org.drools.compiler.builder.impl.errors.MissingImplementationException) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage) PackageRegistry(org.drools.compiler.compiler.PackageRegistry) TypeDeclarationError(org.drools.compiler.compiler.TypeDeclarationError) Collection(java.util.Collection) Process(org.kie.api.definition.process.Process) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) KnowledgeBuilderResult(org.kie.internal.builder.KnowledgeBuilderResult) UUID(java.util.UUID) PrivilegedAction(java.security.PrivilegedAction) BaseDescr(org.drools.drl.ast.descr.BaseDescr) Resource(org.kie.api.io.Resource) List(java.util.List) TypeDeclarationDescr(org.drools.drl.ast.descr.TypeDeclarationDescr) DroolsStreamUtils(org.drools.core.util.DroolsStreamUtils) SAXException(org.xml.sax.SAXException) DroolsError(org.drools.drl.parser.DroolsError) Optional(java.util.Optional) JavaDialectRuntimeData(org.drools.core.rule.JavaDialectRuntimeData) ResourceTypeDeclarationWarning(org.drools.compiler.compiler.ResourceTypeDeclarationWarning) StringUtils(org.drools.core.util.StringUtils) ResourceTypePackage(org.kie.api.internal.io.ResourceTypePackage) KieBaseConfiguration(org.kie.api.KieBaseConfiguration) ClassObjectType(org.drools.core.base.ClassObjectType) ReaderResource(org.drools.core.io.impl.ReaderResource) ClassFieldAccessorCache(org.drools.core.base.ClassFieldAccessorCache) Pattern(org.drools.core.rule.Pattern) HashMap(java.util.HashMap) RuleBuilder(org.drools.compiler.rule.builder.RuleBuilder) TypeFieldDescr(org.drools.drl.ast.descr.TypeFieldDescr) FunctionImportDescr(org.drools.drl.ast.descr.FunctionImportDescr) WindowDeclarationDescr(org.drools.drl.ast.descr.WindowDeclarationDescr) Stack(java.util.Stack) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) PatternDestinationDescr(org.drools.drl.ast.descr.PatternDestinationDescr) HashSet(java.util.HashSet) IoUtils(org.drools.core.util.IoUtils) DSLMappingFile(org.drools.drl.parser.lang.dsl.DSLMappingFile) GuidedRuleTemplateFactory(org.drools.drl.extensions.GuidedRuleTemplateFactory) ResultSeverity(org.kie.internal.builder.ResultSeverity) RuleConditionBuilder(org.drools.compiler.rule.builder.RuleConditionBuilder) KnowledgePackageImpl(org.drools.core.definitions.impl.KnowledgePackageImpl) KieBase(org.kie.api.KieBase) KiePackage(org.kie.api.definition.KiePackage) RuleBuildError(org.drools.compiler.compiler.RuleBuildError) RuleBase(org.drools.core.impl.RuleBase) KnowledgeBuilderResults(org.kie.internal.builder.KnowledgeBuilderResults) ConditionalElementDescr(org.drools.drl.ast.descr.ConditionalElementDescr) AccumulateImportDescr(org.drools.drl.ast.descr.AccumulateImportDescr) Logger(org.slf4j.Logger) InternalResource(org.drools.core.io.internal.InternalResource) ComponentsFactory(org.drools.wiring.api.ComponentsFactory) KieService(org.kie.api.internal.utils.KieService) EnumDeclarationDescr(org.drools.drl.ast.descr.EnumDeclarationDescr) PackageBuilderErrors(org.drools.compiler.compiler.PackageBuilderErrors) GlobalError(org.drools.compiler.compiler.GlobalError) AnnotationDeclarationError(org.drools.compiler.compiler.AnnotationDeclarationError) InternalKnowledgeBuilder(org.drools.compiler.builder.InternalKnowledgeBuilder) ProjectClassLoader(org.drools.wiring.api.classloader.ProjectClassLoader) ProcessBuilderFactory(org.drools.compiler.compiler.ProcessBuilderFactory) ExpanderException(org.drools.drl.parser.lang.ExpanderException) CompositePackageDescr(org.drools.compiler.lang.descr.CompositePackageDescr) Collections(java.util.Collections) ParserError(org.drools.drl.parser.ParserError) InputStream(java.io.InputStream) BaseKnowledgeBuilderResultImpl(org.drools.drl.parser.BaseKnowledgeBuilderResultImpl) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) RuleDescr(org.drools.drl.ast.descr.RuleDescr) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ExecutionException(java.util.concurrent.ExecutionException)

Example 27 with RuleBuildContext

use of org.drools.compiler.rule.builder.RuleBuildContext in project drools by kiegroup.

the class KnowledgeBuilderImpl method processWindowDeclarations.

protected void processWindowDeclarations(PackageRegistry pkgRegistry, PackageDescr packageDescr) {
    for (WindowDeclarationDescr wd : packageDescr.getWindowDeclarations()) {
        WindowDeclaration window = new WindowDeclaration(wd.getName(), packageDescr.getName());
        // TODO: process annotations
        // process pattern
        InternalKnowledgePackage pkg = pkgRegistry.getPackage();
        DialectCompiletimeRegistry ctr = pkgRegistry.getDialectCompiletimeRegistry();
        RuleDescr dummy = new RuleDescr(wd.getName() + " Window Declaration");
        dummy.setResource(packageDescr.getResource());
        dummy.addAttribute(new AttributeDescr("dialect", "java"));
        RuleBuildContext context = new RuleBuildContext(this, dummy, ctr, pkg, ctr.getDialect(pkgRegistry.getDialect()));
        final RuleConditionBuilder builder = (RuleConditionBuilder) context.getDialect().getBuilder(wd.getPattern().getClass());
        if (builder != null) {
            final Pattern pattern = (Pattern) builder.build(context, wd.getPattern(), null);
            if (pattern.getXpathConstraint() != null) {
                context.addError(new DescrBuildError(wd, context.getParentDescr(), null, "OOpath expression " + pattern.getXpathConstraint() + " not allowed in window declaration\n"));
            }
            window.setPattern(pattern);
        } else {
            throw new RuntimeException("BUG: assembler not found for descriptor class " + wd.getPattern().getClass());
        }
        if (!context.getErrors().isEmpty()) {
            for (DroolsError error : context.getErrors()) {
                addBuilderResult(error);
            }
        } else {
            pkgRegistry.getPackage().addWindowDeclaration(window);
        }
    }
}
Also used : Pattern(org.drools.core.rule.Pattern) DroolsError(org.drools.drl.parser.DroolsError) DescrBuildError(org.drools.compiler.compiler.DescrBuildError) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) DialectCompiletimeRegistry(org.drools.compiler.compiler.DialectCompiletimeRegistry) WindowDeclaration(org.drools.core.rule.WindowDeclaration) RuleDescr(org.drools.drl.ast.descr.RuleDescr) RuleConditionBuilder(org.drools.compiler.rule.builder.RuleConditionBuilder) WindowDeclarationDescr(org.drools.drl.ast.descr.WindowDeclarationDescr) AttributeDescr(org.drools.drl.ast.descr.AttributeDescr) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage)

Example 28 with RuleBuildContext

use of org.drools.compiler.rule.builder.RuleBuildContext in project drools by kiegroup.

the class KnowledgeBuilderImpl method buildRuleBuilderContexts.

private Map<String, RuleBuildContext> buildRuleBuilderContexts(List<RuleDescr> rules, PackageRegistry pkgRegistry) {
    Map<String, RuleBuildContext> map = new HashMap<>();
    for (RuleDescr ruleDescr : rules) {
        RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr);
        map.put(ruleDescr.getName(), context);
        pkgRegistry.getPackage().addRule(context.getRule());
    }
    return map;
}
Also used : RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) LinkedHashMap(java.util.LinkedHashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) RuleDescr(org.drools.drl.ast.descr.RuleDescr)

Example 29 with RuleBuildContext

use of org.drools.compiler.rule.builder.RuleBuildContext in project drools by kiegroup.

the class JavaConsequenceBuilderPRAlwaysTest method setupTest.

private void setupTest(String consequence, Map<String, Object> namedConsequences) {
    InternalKnowledgePackage pkg = CoreComponentFactory.get().createKnowledgePackage("org.drools");
    pkg.addImport(new ImportDeclaration("org.drools.mvel.compiler.Cheese"));
    KnowledgeBuilderConfigurationImpl conf = new KnowledgeBuilderConfigurationImpl();
    // Although it should be the default, for completeness we explicit this is the test cases how RHS should be rewritten as:
    conf.setOption(PropertySpecificOption.ALWAYS);
    KnowledgeBuilderImpl kBuilder = new KnowledgeBuilderImpl(pkg, conf);
    ruleDescr = new RuleDescr("test consequence builder");
    ruleDescr.setConsequence(consequence);
    for (Entry<String, Object> entry : namedConsequences.entrySet()) {
        ruleDescr.addNamedConsequences(entry.getKey(), entry.getValue());
    }
    RuleImpl rule = descrToRule(ruleDescr);
    PackageRegistry pkgRegistry = kBuilder.getPackageRegistry(pkg.getName());
    DialectCompiletimeRegistry reg = kBuilder.getPackageRegistry(pkg.getName()).getDialectCompiletimeRegistry();
    context = new RuleBuildContext(kBuilder, ruleDescr, reg, pkg, reg.getDialect(pkgRegistry.getDialect()));
    rule.addPattern(new Pattern(0, new ClassObjectType(Cheese.class), "$cheese"));
    Pattern p = new Pattern(1, new ClassObjectType(Person.class), "$persone");
    Declaration declr = p.addDeclaration("age");
    final InternalReadAccessor extractor = PatternBuilder.getFieldReadAccessor(context, new BindingDescr("age", "age"), p, "age", declr, true);
    rule.addPattern(p);
    context.getDeclarationResolver().pushOnBuildStack(rule.getLhs());
    context.getDialect().getConsequenceBuilder().build(context, RuleImpl.DEFAULT_CONSEQUENCE_NAME);
    for (String name : namedConsequences.keySet()) {
        context.getDialect().getConsequenceBuilder().build(context, name);
    }
    context.getDialect().addRule(context);
    pkgRegistry.getPackage().addRule(context.getRule());
    kBuilder.compileAll();
    kBuilder.reloadAll();
}
Also used : Pattern(org.drools.core.rule.Pattern) BindingDescr(org.drools.drl.ast.descr.BindingDescr) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) ClassObjectType(org.drools.core.base.ClassObjectType) KnowledgeBuilderConfigurationImpl(org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl) DialectCompiletimeRegistry(org.drools.compiler.compiler.DialectCompiletimeRegistry) RuleImpl(org.drools.core.definitions.rule.impl.RuleImpl) PackageRegistry(org.drools.compiler.compiler.PackageRegistry) KnowledgeBuilderImpl(org.drools.compiler.builder.impl.KnowledgeBuilderImpl) ImportDeclaration(org.drools.core.rule.ImportDeclaration) RuleDescr(org.drools.drl.ast.descr.RuleDescr) InternalReadAccessor(org.drools.core.spi.InternalReadAccessor) Declaration(org.drools.core.rule.Declaration) ImportDeclaration(org.drools.core.rule.ImportDeclaration) Person(org.drools.mvel.compiler.Person) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage)

Example 30 with RuleBuildContext

use of org.drools.compiler.rule.builder.RuleBuildContext in project drools by kiegroup.

the class MVELConsequenceBuilderTest method testSimpleExpression.

@Test
public void testSimpleExpression() throws Exception {
    PackageDescr pkgDescr = new PackageDescr("pkg1");
    KnowledgeBuilderImpl pkgBuilder = new KnowledgeBuilderImpl();
    pkgBuilder.addPackage(pkgDescr);
    InternalKnowledgePackage pkg = pkgBuilder.getPackageRegistry("pkg1").getPackage();
    final RuleDescr ruleDescr = new RuleDescr("rule 1");
    ruleDescr.setNamespace("pkg1");
    ruleDescr.setConsequence("modify (cheese) {price = 5 };\nretract (cheese)");
    DialectCompiletimeRegistry dialectRegistry = pkgBuilder.getPackageRegistry(pkg.getName()).getDialectCompiletimeRegistry();
    MVELDialect mvelDialect = (MVELDialect) dialectRegistry.getDialect("mvel");
    final RuleBuildContext context = new RuleBuildContext(pkgBuilder, ruleDescr, dialectRegistry, pkg, mvelDialect);
    final InstrumentedDeclarationScopeResolver declarationResolver = new InstrumentedDeclarationScopeResolver();
    final ObjectType cheeseObjeectType = new ClassObjectType(Cheese.class);
    final Pattern pattern = new Pattern(0, cheeseObjeectType, "cheese");
    final GroupElement subrule = new GroupElement(GroupElement.AND);
    subrule.addChild(pattern);
    final Map<String, Declaration> map = new HashMap<String, Declaration>();
    map.put("cheese", pattern.getDeclaration());
    declarationResolver.setDeclarations(map);
    context.setDeclarationResolver(declarationResolver);
    final MVELConsequenceBuilder builder = new MVELConsequenceBuilder();
    builder.build(context, RuleImpl.DEFAULT_CONSEQUENCE_NAME);
    InternalKnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
    PropagationContextFactory pctxFactory = RuntimeComponentFactory.get().getPropagationContextFactory();
    kBase.addPackage(pkg);
    StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl) kBase.newKieSession();
    BuildContext buildContext = new BuildContext(kBase, Collections.emptyList());
    MockTupleSource source = new MockTupleSource(1, buildContext);
    source.setObjectCount(1);
    RuleTerminalNode rtn = new RuleTerminalNode(0, source, context.getRule(), subrule, 0, buildContext);
    final Cheese cheddar = new Cheese("cheddar", 10);
    final InternalFactHandle f0 = (InternalFactHandle) ksession.insert(cheddar);
    final LeftTupleImpl tuple = new LeftTupleImpl(f0, rtn, true);
    f0.removeLeftTuple(tuple);
    final AgendaItem item = new AgendaItemImpl(0, tuple, 10, pctxFactory.createPropagationContext(1, PropagationContext.Type.DELETION, null, null, null), rtn, null);
    final DefaultKnowledgeHelper kbHelper = new DefaultKnowledgeHelper(ksession);
    kbHelper.setActivation(item);
    ((MVELConsequence) context.getRule().getConsequence()).compile((MVELDialectRuntimeData) pkgBuilder.getPackageRegistry(pkg.getName()).getDialectRuntimeRegistry().getDialectData("mvel"));
    context.getRule().getConsequence().evaluate(kbHelper, ksession);
    assertEquals(5, cheddar.getPrice());
}
Also used : ClassObjectType(org.drools.core.base.ClassObjectType) HashMap(java.util.HashMap) GroupElement(org.drools.core.rule.GroupElement) Cheese(org.drools.mvel.compiler.Cheese) MVELConsequence(org.drools.mvel.expr.MVELConsequence) AgendaItem(org.drools.core.common.AgendaItem) ClassObjectType(org.drools.core.base.ClassObjectType) ObjectType(org.drools.core.spi.ObjectType) MockTupleSource(org.drools.core.reteoo.MockTupleSource) LeftTupleImpl(org.drools.core.reteoo.LeftTupleImpl) AgendaItemImpl(org.drools.core.common.AgendaItemImpl) Declaration(org.drools.core.rule.Declaration) ImportDeclaration(org.drools.core.rule.ImportDeclaration) PackageDescr(org.drools.drl.ast.descr.PackageDescr) InternalFactHandle(org.drools.core.common.InternalFactHandle) InternalKnowledgeBase(org.drools.kiesession.rulebase.InternalKnowledgeBase) RuleTerminalNode(org.drools.core.reteoo.RuleTerminalNode) Pattern(org.drools.core.rule.Pattern) PropagationContextFactory(org.drools.core.common.PropagationContextFactory) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) DialectCompiletimeRegistry(org.drools.compiler.compiler.DialectCompiletimeRegistry) DefaultKnowledgeHelper(org.drools.kiesession.consequence.DefaultKnowledgeHelper) MVELDialect(org.drools.mvel.builder.MVELDialect) BuildContext(org.drools.core.reteoo.builder.BuildContext) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) MVELConsequenceBuilder(org.drools.mvel.builder.MVELConsequenceBuilder) KnowledgeBuilderImpl(org.drools.compiler.builder.impl.KnowledgeBuilderImpl) StatefulKnowledgeSessionImpl(org.drools.kiesession.session.StatefulKnowledgeSessionImpl) RuleDescr(org.drools.drl.ast.descr.RuleDescr) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage) Test(org.junit.Test)

Aggregations

RuleBuildContext (org.drools.compiler.rule.builder.RuleBuildContext)35 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)24 DialectCompiletimeRegistry (org.drools.compiler.compiler.DialectCompiletimeRegistry)23 InternalKnowledgePackage (org.drools.core.definitions.InternalKnowledgePackage)22 Test (org.junit.Test)18 RuleDescr (org.drools.drl.ast.descr.RuleDescr)17 Pattern (org.drools.core.rule.Pattern)16 ClassObjectType (org.drools.core.base.ClassObjectType)15 RuleImpl (org.drools.core.definitions.rule.impl.RuleImpl)15 KnowledgeBuilderConfigurationImpl (org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl)14 Declaration (org.drools.core.rule.Declaration)14 RuleDescr (org.drools.compiler.lang.descr.RuleDescr)13 HashMap (java.util.HashMap)12 PackageRegistry (org.drools.compiler.compiler.PackageRegistry)11 ImportDeclaration (org.drools.core.rule.ImportDeclaration)11 InternalFactHandle (org.drools.core.common.InternalFactHandle)8 KnowledgePackageImpl (org.drools.core.definitions.impl.KnowledgePackageImpl)8 LeftTupleImpl (org.drools.core.reteoo.LeftTupleImpl)8 ObjectType (org.drools.core.spi.ObjectType)7 InternalReadAccessor (org.drools.core.spi.InternalReadAccessor)6