Package org.kie

Examples of org.kie.KieBaseConfiguration


    public void setUp(int type) {
        setUp(new int[] { type, type, type, type, type, type, type, type } );
    }
   
    public void setUp(int... type) {
        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf);
        buildContext = new BuildContext( ruleBase, ruleBase.getReteooBuilder().getIdGenerator() );

        context = new PropagationContextImpl( 0, PropagationContext.INSERTION, null, null, null );
View Full Code Here


        rule1 = new Rule( "rule1" );
        rule2 = new Rule( "rule2" );
        rule3 = new Rule( "rule3" );

        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf);
        BuildContext buildContext = new BuildContext( ruleBase, ruleBase.getReteooBuilder().getIdGenerator() );

        MockObjectSource mockObjectSource = new MockObjectSource( 8 );
        MockTupleSource mockTupleSource = new MockTupleSource( 9 );
View Full Code Here

   
    @Test
    public void testLiaNodeInitialisation() {
        setUp( JOIN_NODE );
        // Initialise from lian
        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ReteooWorkingMemory wm = new ReteooWorkingMemory( 1, (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf) );
        SegmentUtilities.createSegmentMemory( liaNode, wm );
        liaNode.assertObject( (InternalFactHandle) wm.insert( "str" ), context, wm );
       
View Full Code Here

   
    @Test
    public void testLiaNodeLinking() {
        setUp( JOIN_NODE );
        // Initialise from lian
        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ReteooWorkingMemory wm = new ReteooWorkingMemory( 1, (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf) );
       
        SegmentUtilities.createSegmentMemory( liaNode, wm );
       
        InternalFactHandle fh1 = (InternalFactHandle) wm.insert( "str1" );
View Full Code Here

    @Test
    public void tesMultiNodeSegmentDifferentInitialisationPoints() {
        setUp( JOIN_NODE );
        // Initialise from n3
        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ReteooWorkingMemory wm = new ReteooWorkingMemory( 1, (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf) );
        createSegmentMemory( n3, wm );

        BetaMemory bm = (BetaMemory) wm.getNodeMemory( n1 );
        assertNull( bm.getSegmentMemory() );
View Full Code Here

    public void testAllLinkedInWithJoinNodesOnly() {
        setUp( JOIN_NODE );

        assertEquals( JoinNode.class, n3.getClass() ); // make sure it created JoinNodes

        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ReteooWorkingMemory wm = new ReteooWorkingMemory( 1, (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf) );
        DefaultFactHandle f1 = (DefaultFactHandle) wm.insert( "test1" );
        n3.assertObject( f1, context, wm );

        BetaMemory bm = (BetaMemory) wm.getNodeMemory( n3 );
View Full Code Here

    public void testAllLinkedInWithExistsNodesOnly() {
        setUp( EXISTS_NODE );

        assertEquals( ExistsNode.class, n3.getClass() ); // make sure it created ExistsNodes

        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ReteooWorkingMemory wm = new ReteooWorkingMemory( 1, (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf) );
        DefaultFactHandle f1 = (DefaultFactHandle) wm.insert( "test1" );
        n3.assertObject( f1, context, wm );

        BetaMemory bm = (BetaMemory) wm.getNodeMemory( n3 );
View Full Code Here

    public void testAllLinkedInWithNotNodesOnly() {
        setUp( NOT_NODE );

        assertEquals( NotNode.class, n3.getClass() ); // make sure it created ExistsNodes

        KieBaseConfiguration kconf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kconf.setOption( LRUnlinkingOption.ENABLED );       
        ReteooWorkingMemory wm = new ReteooWorkingMemory( 1, (ReteooRuleBase) RuleBaseFactory.newRuleBase((RuleBaseConfiguration)kconf) );
               
        BetaMemory bm = (BetaMemory) wm.getNodeMemory( n3 );
        createSegmentMemory( n3, wm );
        assertTrue( bm.getSegmentMemory().isSegmentLinked() ); // not nodes start off linked
View Full Code Here

    @Override
    public void init(BenchmarkDefinition definition, boolean isFirst) {
        if (isFirst) {
            KnowledgeBuilder kbuilder = createKnowledgeBuilder("cep.drl");

            KieBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
            config.setOption( EventProcessingOption.STREAM );

            kbase = KnowledgeBaseFactory.newKnowledgeBase(config);
            kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
        }
View Full Code Here

        kBase.addKnowledgePackages( pkgs );
        return kBase;
    }

    private static KieBaseConfiguration getKnowledgeBaseConfiguration(KieBaseModelImpl kBaseModel, ClassLoader cl) {
        KieBaseConfiguration kbConf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null, cl);
        kbConf.setOption(kBaseModel.getEqualsBehavior());
        kbConf.setOption(kBaseModel.getEventProcessingMode());
        return kbConf;
    }
View Full Code Here

TOP

Related Classes of org.kie.KieBaseConfiguration

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.