Package org.kie

Examples of org.kie.KieBase


    public KieBase getKieBase() {
        return getKieBase( KieBaseModelImpl.DEFAULT_KIEBASE_NAME );
    }

    public KieBase getKieBase(String kBaseName) {
        KieBase kBase = kBases.get( kBaseName );
        if ( kBase == null ) {
            if ( kProject != null ) {
                kBase = AbstractKieModule.createKieBase( kProject.getKieBaseModel( kBaseName ),
                                                         kProject );
                if ( kBase != null ) {
View Full Code Here


    public KieSession getKieSession(String kSessionName) {
        KieSessionModelImpl kSessionModel = (KieSessionModelImpl) kProject.getKieSessionModel( kSessionName );
        if ( kSessionModel == null ) {
            return null;
        }
        KieBase kBase = getKieBase( kSessionModel.getKieBaseModel().getName() );
        if ( kBase != null ) {
            return kBase.newKieSession();
        } else {
            return null;
        }
    }
View Full Code Here

    public StatelessKieSession getKieStatelessSession(String kSessionName) {
        KieSessionModelImpl kSessionModel = (KieSessionModelImpl) kProject.getKieSessionModel( kSessionName );
        if ( kSessionName == null ) {
            return null;
        }
        KieBase kBase = getKieBase( kSessionModel.getKieBaseModel().getName() );
        if ( kBase != null ) {
            return kBase.newStatelessKieSession();
        } else {
            return null;
        }
    }
View Full Code Here

                                                                                                   }
                    ) ) );
        }

        public KieBase create(CreationalContext ctx) {
            KieBase kieBase = kieContainer.getKieBase( kBaseModel.getName() );
            return kieBase;
        }
View Full Code Here

        KieFactory kf = KieFactory.Factory.get();

        KieFileSystem kfs = kf.newKieFileSystem().write( "src/main/resources/r1.drl", str );
        ks.newKieBuilder( kfs ).build();

        KieBase kbase = ks.getKieContainer(ks.getKieRepository().getDefaultGAV()).getKieBase();
        KieSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );

        List<?> list = new ArrayList<Object>();

        ksession.setGlobal( "list",
View Full Code Here

        KieFactory kf = KieFactory.Factory.get();

        KieFileSystem kfs = kf.newKieFileSystem().write( "src/main/resources/r1.drl", str );
        ks.newKieBuilder( kfs ).build();

        KieBase kbase = ks.getKieContainer(ks.getKieRepository().getDefaultGAV()).getKieBase();
        KieSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );

        List<?> list = new ArrayList<Object>();

        ksession.setGlobal( "list",
View Full Code Here

        KieFactory kf = KieFactory.Factory.get();

        KieFileSystem kfs = kf.newKieFileSystem().write( "src/main/resources/r1.drl", str );
        ks.newKieBuilder( kfs ).build();

        KieBase kbase = ks.getKieContainer(ks.getKieRepository().getDefaultGAV()).getKieBase();

        UserTransaction ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
        ut.begin();
        KieSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
        ut.commit();
View Full Code Here

        KieFactory kf = KieFactory.Factory.get();

        KieFileSystem kfs = kf.newKieFileSystem().write( "src/main/resources/r1.drl", str );
        ks.newKieBuilder( kfs ).build();

        KieBase kbase = ks.getKieContainer(ks.getKieRepository().getDefaultGAV()).getKieBase();

        KieSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
        SingleSessionCommandService sscs = (SingleSessionCommandService)
            ((CommandBasedStatefulKnowledgeSession) ksession).getCommandService();
        sscs.addInterceptor(new LoggingInterceptor());
View Full Code Here

        KieFactory kf = KieFactory.Factory.get();

        KieFileSystem kfs = kf.newKieFileSystem().write( "src/main/resources/r1.drl", str );
        ks.newKieBuilder( kfs ).build();

        KieBase kbase = ks.getKieContainer(ks.getKieRepository().getDefaultGAV()).getKieBase();

        KieSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
        List<?> list = new ArrayList<Object>();
   
        ksession.setGlobal( "list",
View Full Code Here

    }
   
    @Test
    public void testSharedReferences() {
        KieServices ks = KieServices.Factory.get();
        KieBase kbase = ks.getKieContainer(ks.getKieRepository().getDefaultGAV()).getKieBase();
        KieSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );

        Person x = new Person( "test" );
        List test = new ArrayList();
        List test2 = new ArrayList();
View Full Code Here

TOP

Related Classes of org.kie.KieBase

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.