Package org.kie.runtime

Examples of org.kie.runtime.KieSession.dispose()


        ProcessInstance processInstance = service.startProcess( "org.drools.test.ProcessTimer" );
        long procId = processInstance.getId();
        log.info( "---> Started ProcessTimer id: {}",
                  procId );

        service.dispose();
        log.info( "---> session disposed" );

        final Environment env = (Environment) ctx.getBean( "env" );
        /*
        Environment env = KnowledgeBaseFactory.newEnvironment();
View Full Code Here


        log.info( "---> GetProcessInstanceCommand id: " + procId );
        assertNotNull( processInstance );

        Thread.sleep( 1000 );
        log.info( "---> session disposed" );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
View Full Code Here

                                                                   workItemHandler );

            ksession.startProcess( "timer-flow",
                                   null );
            Thread.sleep( 4000 );
            ksession.dispose();
        } catch ( Exception ex ) {
            throw new IllegalStateException("The endTheProcess method has been interrupted", ex);
        }
    }
View Full Code Here

            logger.info( "\n\nSleeping to check that the timer is no longer running" );
            Thread.sleep( 3000 );
            logger.info( "Ok" );

            ksession.dispose();

        } catch ( InterruptedException ex ) {
            throw new IllegalStateException("The endTheProcess method has been interrupted", ex);
        }
    }
View Full Code Here

        KieSession statefulSession = (KieSession) context.getBean( "ConsoleLogger-statefulSession" );
        StatefulKnowledgeSessionImpl impl = (StatefulKnowledgeSessionImpl)statefulSession;
        for ( Object listener : impl.session.getWorkingMemoryEventListeners()) {
            assertTrue(listener instanceof WorkingMemoryConsoleLogger);
        }
        statefulSession.dispose();
    }

    @Test
    public void testStatefulKnowledgeFileLogger() throws Exception {
        KieSession statefulSession = (KieSession) context.getBean( "FileLogger-statefulSession" );
View Full Code Here

        }
        KnowledgeLoggerAdaptor adaptor = (KnowledgeLoggerAdaptor) context.getBean("sf_fl_logger");
        assertNotNull(adaptor);
        assertNotNull(adaptor.getRuntimeLogger());

        statefulSession.dispose();
    }

    @Test
    public void testStatefulKnowledgeThreadedFileLogger() throws Exception {
        KieSession statefulSession = (KieSession) context.getBean( "ThreadedFileLogger-statefulSession" );
View Full Code Here

            assertTrue(listener instanceof ThreadedWorkingMemoryFileLogger);
        }
        KnowledgeLoggerAdaptor adaptor = (KnowledgeLoggerAdaptor) context.getBean("sf_tfl_logger");
        assertNotNull(adaptor);
        assertNotNull(adaptor.getRuntimeLogger());
        statefulSession.dispose();
    }

    @Test
    public void testStatelessKnowledgeConsoleLogger() throws Exception {
        StatelessKieSession statelessKnowledgeSession = (StatelessKieSession) context.getBean( "ConsoleLogger-statelessSession" );
View Full Code Here

        service.getWorkItemManager().completeWorkItem( workItem.getId(),
                                                       null );

        workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
View Full Code Here

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        processInstance = service.getProcessInstance( processInstance.getId() );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
View Full Code Here

        service.getWorkItemManager().completeWorkItem( workItem.getId(),
                                                       null );

        workItem = handler.getWorkItem();
        assertNull( workItem );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
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.