Package org.drools.core.reteoo.builder

Examples of org.drools.core.reteoo.builder.NodeFactory


         * MockObjectSink so we can detect assertions and retractions
         */
        final ReteooRuleBase ruleBase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase();
        BuildContext context = new BuildContext(ruleBase, ruleBase.getReteooBuilder().getIdGenerator() );

        NodeFactory nFacotry = ((ReteooRuleBase) ruleBase).getConfiguration().getComponentFactory().getNodeFactoryService();
        final EntryPointNode entryPoint = nFacotry.buildEntryPointNode( -1, ruleBase.getRete(), context );
        entryPoint.attach(context);
                       
        final ObjectTypeNode objectTypeNode = nFacotry.buildObjectTypeNode( 0, entryPoint, new ClassObjectType( Object.class ), context );
        objectTypeNode.attach(context);

        final MockObjectSink sink = new MockObjectSink();
        objectTypeNode.addObjectSink( sink );
      
View Full Code Here


       
        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        ReteooRuleBase rbase = ( ReteooRuleBase ) ((KnowledgeBaseImpl)kbase).getRuleBase();
        Rete rete = rbase.getRete();

        NodeFactory nFacotry = ((ReteooRuleBase) rbase).getConfiguration().getComponentFactory().getNodeFactoryService();
        EntryPointNode epn = nFacotry.buildEntryPointNode( rbase.getReteooBuilder().getIdGenerator().getNextId(),
                                                            RuleBasePartitionId.MAIN_PARTITION,
                                                            rbase.getConfiguration().isMultithreadEvaluation(),
                                                            rete,
                                                            new EntryPointId( "xxx" ) );
       
View Full Code Here

   
    private InternalFactHandle createEventFactHandle(AbstractWorkingMemory wm, RuleBase ruleBase) {
        // EntryPointNode
        Rete rete = ((ReteooRuleBase) ruleBase).getRete();

        NodeFactory nFacotry = ((ReteooRuleBase) ruleBase).getConfiguration().getComponentFactory().getNodeFactoryService();

        RuleBasePartitionId partionId = new RuleBasePartitionId("P-MAIN");
        EntryPointNode entryPointNode = nFacotry.buildEntryPointNode(1, partionId, false, (ObjectSource) rete , EntryPointId.DEFAULT);
        EntryPoint wmEntryPoint = new NamedEntryPoint(EntryPointId.DEFAULT, entryPointNode, wm);

        EventFactHandle factHandle = new EventFactHandle(1, (Object) new Person(),0, (new Date()).getTime(), 0, wmEntryPoint);
       
        return factHandle;
View Full Code Here

        this.constraintVariableName = constraintVariableName;
        return this;
    }

    public BetaNode build() {
        NodeFactory nFactory = buildContext.getComponentFactory().getNodeFactoryService();
        EntryPointNode epn = nFactory.buildEntryPointNode(buildContext.getNextId(),
                                                          buildContext.getRuleBase().getRete(),
                                                          buildContext);
        epn.attach(buildContext);

        ObjectTypeNode otn = nFactory.buildObjectTypeNode(buildContext.getNextId(),
                                                          epn,
                                                          new ClassObjectType(leftType),
                                                          buildContext);

        LeftInputAdapterNode leftInput = nFactory.buildLeftInputAdapterNode(buildContext.getNextId(),
                                                                            otn,
                                                                            buildContext);

        ObjectSource rightInput = nFactory.buildObjectTypeNode(buildContext.getNextId(),
                                                               epn,
                                                               new ClassObjectType(rightType),
                                                               buildContext);

        ReteTesterHelper reteTesterHelper = new ReteTesterHelper();
View Full Code Here

   
    private InternalFactHandle createEventFactHandle(StatefulKnowledgeSessionImpl wm, InternalKnowledgeBase kBase) {
        // EntryPointNode
        Rete rete = kBase.getRete();

        NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService();

        RuleBasePartitionId partionId = new RuleBasePartitionId("P-MAIN");
        EntryPointNode entryPointNode = nFacotry.buildEntryPointNode(1, partionId, false, (ObjectSource) rete , EntryPointId.DEFAULT);
        EntryPoint wmEntryPoint = new NamedEntryPoint(EntryPointId.DEFAULT, entryPointNode, wm);

        EventFactHandle factHandle = new EventFactHandle(1, (Object) new Person(),0, (new Date()).getTime(), 0, wmEntryPoint);
       
        return factHandle;
View Full Code Here

   
    private InternalFactHandle createEventFactHandle(AbstractWorkingMemory wm, RuleBase ruleBase) {
        // EntryPointNode
        Rete rete = ((ReteooRuleBase) ruleBase).getRete();

        NodeFactory nFacotry = ((ReteooRuleBase) ruleBase).getConfiguration().getComponentFactory().getNodeFactoryService();

        RuleBasePartitionId partionId = new RuleBasePartitionId("P-MAIN");
        EntryPointNode entryPointNode = nFacotry.buildEntryPointNode(1, partionId, false, (ObjectSource) rete , EntryPointId.DEFAULT);
        EntryPoint wmEntryPoint = new NamedEntryPoint(EntryPointId.DEFAULT, entryPointNode, wm);

        EventFactHandle factHandle = new EventFactHandle(1, (Object) new Person(),0, (new Date()).getTime(), 0, wmEntryPoint);
       
        return factHandle;
View Full Code Here

        this.constraintVariableName = constraintVariableName;
        return this;
    }

    public BetaNode build() {
        NodeFactory nFactory = buildContext.getComponentFactory().getNodeFactoryService();
        EntryPointNode epn = nFactory.buildEntryPointNode(buildContext.getNextId(),
                                                          buildContext.getKnowledgeBase().getRete(),
                                                          buildContext);
        epn.attach(buildContext);

        ObjectTypeNode otn = nFactory.buildObjectTypeNode(buildContext.getNextId(),
                                                          epn,
                                                          new ClassObjectType(leftType),
                                                          buildContext);

        LeftInputAdapterNode leftInput = nFactory.buildLeftInputAdapterNode(buildContext.getNextId(),
                                                                            otn,
                                                                            buildContext);

        ObjectSource rightInput = nFactory.buildObjectTypeNode(buildContext.getNextId(),
                                                               epn,
                                                               new ClassObjectType(rightType),
                                                               buildContext);

        ReteTesterHelper reteTesterHelper = new ReteTesterHelper();
View Full Code Here

        //JBRULES-2971

        InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase();
        Rete rete = kBase.getRete();

        NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService();
        EntryPointNode epn = nFacotry.buildEntryPointNode( kBase.getReteooBuilder().getIdGenerator().getNextId(),
                                                            RuleBasePartitionId.MAIN_PARTITION,
                                                            kBase.getConfiguration().isMultithreadEvaluation(),
                                                            rete,
                                                            new EntryPointId( "xxx" ) );
View Full Code Here

         * MockObjectSink so we can detect assertions and retractions
         */
        InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase();
        BuildContext context = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator() );

        NodeFactory nFacotry = kBase.getConfiguration().getComponentFactory().getNodeFactoryService();
        final EntryPointNode entryPoint = nFacotry.buildEntryPointNode( -1, kBase.getRete(), context );
        entryPoint.attach(context);
                       
        final ObjectTypeNode objectTypeNode = nFacotry.buildObjectTypeNode( 0, entryPoint, new ClassObjectType( Object.class ), context );
        objectTypeNode.attach(context);

        final MockObjectSink sink = new MockObjectSink();
        objectTypeNode.addObjectSink( sink );

View Full Code Here

   
    private InternalFactHandle createEventFactHandle(AbstractWorkingMemory wm, RuleBase ruleBase) {
        // EntryPointNode
        Rete rete = ((ReteooRuleBase) ruleBase).getRete();

        NodeFactory nFacotry = ((ReteooRuleBase) ruleBase).getConfiguration().getComponentFactory().getNodeFactoryService();

        RuleBasePartitionId partionId = new RuleBasePartitionId("P-MAIN");
        EntryPointNode entryPointNode = nFacotry.buildEntryPointNode(1, partionId, false, (ObjectSource) rete , EntryPointId.DEFAULT);
        EntryPoint wmEntryPoint = new NamedEntryPoint(EntryPointId.DEFAULT, entryPointNode, wm);

        EventFactHandle factHandle = new EventFactHandle(1, (Object) new Person(),0, (new Date()).getTime(), 0, wmEntryPoint);
       
        return factHandle;
View Full Code Here

TOP

Related Classes of org.drools.core.reteoo.builder.NodeFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.