Examples of EnvironmentAdapter


Examples of org.drools.impl.adapters.EnvironmentAdapter

        kieBaseConf.setOption(RuleEngineOption.RETEOO);
        return new KnowledgeBaseAdapter(delegate.newKnowledgeBase(kbaseId, kieBaseConf));
    }

    public Environment newEnvironment() {
        return new EnvironmentAdapter(delegate.newEnvironment());
    }
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

    @Test
    public void testTransactionsRollback() throws Exception {
        final List< ? > list = new ArrayList<Object>();
        PlatformTransactionManager txManager = (PlatformTransactionManager) ctx.getBean( "txManager" );

        final Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 txManager );
        env.set( EnvironmentName.GLOBALS,
                 new MapGlobalResolver() );
       
        env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                 new ObjectMarshallingStrategy[]{new JPAPlaceholderResolverStrategy( env ),
                                                                    new SerializablePlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );

        final KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        final KieBase kbRollback = (KieBase) ctx.getBean( "kbRollback" );
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

        //        List< ? > result = emf.createEntityManager().createQuery( "select i from VariableInstanceInfo i" ).getResultList();
        //        assertEquals( 5,
        //                      result.size() );
        log.info( "### Retrieving process instance ###" );

        Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 emf );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );
        env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                 new ObjectMarshallingStrategy[]{
                                                                  //  new JPAPlaceholderResolverStrategy(env),
                                                                  new SerializablePlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )
                                                                } );
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

    public boolean isSingleton() {
        return false;
    }

    public void afterPropertiesSet() throws Exception {
        environment = new EnvironmentAdapter( EnvironmentFactory.newEnvironment() );
        if ( entityManagerFactory != null ) {
            environment.set(EnvironmentName.ENTITY_MANAGER_FACTORY, entityManagerFactory);
        }
        if ( transactionManager != null ){
            environment.set(EnvironmentName.TRANSACTION_MANAGER, transactionManager);
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

            map.putAll( getWorkItems() );
        }

        if ( jpaConfiguration != null ) {

            Environment env = new EnvironmentAdapter( EnvironmentFactory.newEnvironment() );
            env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                     jpaConfiguration.getEntityManagerFactory() );
            env.set( EnvironmentName.TRANSACTION_MANAGER,
                     jpaConfiguration.getPlatformTransactionManager() );
            env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                     new ObjectMarshallingStrategy[]{new SerializablePlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );

            if ( jpaConfiguration.getId() >= 0 ) {
                ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( jpaConfiguration.getId(),
                                                                             getKbase(),
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

        TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
        WorkItem workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );

        KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadKieSessionsessionId,
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

        TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
        WorkItem workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );

        KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadKieSession( sessionId,
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

        TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
        WorkItem workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );

        KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadKieSession( sessionId,
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

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

        Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );

        KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadKieSession( sessionId,
View Full Code Here

Examples of org.drools.impl.adapters.EnvironmentAdapter

        log.info( "Started process instance {}",
                  processInstance.getId() );

        Thread.sleep( 2000 );

        Environment env = new EnvironmentAdapter( KnowledgeBaseFactory.newEnvironment() );
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );

        KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadKieSession( sessionId,
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.