Search in sources :

Example 11 with EntryPointId

use of org.drools.core.rule.EntryPointId in project drools by kiegroup.

the class EntryPointBuilder method build.

/* (non-Javadoc)
     * @see org.kie.reteoo.builder.ReteooComponentBuilder#build(org.kie.reteoo.builder.BuildContext, org.kie.reteoo.builder.BuildUtils, org.kie.rule.RuleConditionElement)
     */
public void build(BuildContext context, BuildUtils utils, RuleConditionElement rce) {
    final EntryPointId entry = (EntryPointId) rce;
    context.setCurrentEntryPoint(entry);
    EntryPointNode epn = context.getKnowledgeBase().getRete().getEntryPointNode(entry);
    if (epn == null) {
        NodeFactory nFactory = context.getComponentFactory().getNodeFactoryService();
        context.setObjectSource(utils.attachNode(context, nFactory.buildEntryPointNode(context.getNextId(), context.getKnowledgeBase().getRete(), context)));
    } else {
        context.setObjectSource(epn);
    }
}
Also used : EntryPointNode(org.drools.core.reteoo.EntryPointNode) EntryPointId(org.drools.core.rule.EntryPointId)

Aggregations

EntryPointId (org.drools.core.rule.EntryPointId)11 WorkingMemoryEntryPoint (org.drools.core.WorkingMemoryEntryPoint)3 NamedEntryPoint (org.drools.core.common.NamedEntryPoint)3 DefaultFactHandle (org.drools.core.common.DefaultFactHandle)2 EventFactHandle (org.drools.core.common.EventFactHandle)2 InternalFactHandle (org.drools.core.common.InternalFactHandle)2 QueryElementFactHandle (org.drools.core.common.QueryElementFactHandle)2 EntryPointNode (org.drools.core.reteoo.EntryPointNode)2 ObjectTypeConf (org.drools.core.reteoo.ObjectTypeConf)2 Declaration (org.drools.core.rule.Declaration)2 ObjectMarshallingStrategy (org.kie.api.marshalling.ObjectMarshallingStrategy)2 EntryPoint (org.kie.api.runtime.rule.EntryPoint)2 AnalysisResult (org.drools.compiler.compiler.AnalysisResult)1 BoundIdentifiers (org.drools.compiler.compiler.BoundIdentifiers)1 DescrBuildError (org.drools.compiler.compiler.DescrBuildError)1 FromDescr (org.drools.compiler.lang.descr.FromDescr)1 MVELDataProvider (org.drools.core.base.dataproviders.MVELDataProvider)1 MVELCompilationUnit (org.drools.core.base.mvel.MVELCompilationUnit)1 InternalWorkingMemoryEntryPoint (org.drools.core.common.InternalWorkingMemoryEntryPoint)1 InternalKnowledgeBase (org.drools.core.impl.InternalKnowledgeBase)1