Examples of ChangeSetImpl


Examples of org.drools.io.impl.ChangeSetImpl

        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        KnowledgeAgent kagent = createKAgent( kbase, false );
        ByteArrayResource bres = (ByteArrayResource) ResourceFactory.newByteArrayResource( spkgs );
        bres.setResourceType( ResourceType.PKG );

        ChangeSetImpl cs = new ChangeSetImpl();
        cs.setResourcesAdded( Arrays.<Resource> asList( bres ) );
        kagent.applyChangeSet( cs );

        KnowledgePackage pack = kagent.getKnowledgeBase().getKnowledgePackage( "test.cep" );
        assertNotNull( pack );
        assertEquals( 1, pack.getRules().size() );
View Full Code Here

Examples of org.drools.io.impl.ChangeSetImpl

        KnowledgeAgent kagent = createKAgent( kbase, false, true );

        ByteArrayResource bres = (ByteArrayResource) ResourceFactory.newByteArrayResource( s1.getBytes() );
        bres.setResourceType( ResourceType.DRL );

        ChangeSetImpl cs = new ChangeSetImpl();
        cs.setResourcesAdded( Arrays.<Resource> asList( bres ) );
        kagent.applyChangeSet( cs );

        KnowledgePackage pack = kagent.getKnowledgeBase().getKnowledgePackage( "org.drools.test.pack1" );
        assertNotNull( pack );
        assertEquals( 0, pack.getRules().size() );
        assertEquals( 1, pack.getFactTypes().size() );


        ByteArrayResource bres2 = (ByteArrayResource) ResourceFactory.newByteArrayResource( s2.getBytes() );
        bres2.setResourceType( ResourceType.DRL );
        ChangeSetImpl cs2 = new ChangeSetImpl();
        cs2.setResourcesAdded( Arrays.<Resource> asList( bres2 ) );
        kagent.applyChangeSet( cs2 );

        pack = kagent.getKnowledgeBase().getKnowledgePackage( "org.drools.test.pack1" );
        assertNotNull( pack );
        assertEquals( 0, pack.getRules().size() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.