Package org.jbpm.ruleflow.instance

Examples of org.jbpm.ruleflow.instance.RuleFlowProcessInstance


        KieSession service = (KieSession) ctx.getBean( "jpaSingleSessionCommandService" );

        int sessionId = service.getId();

        RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) service.startProcess( "org.drools.test.ProcessSubProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );
        long processInstanceId = processInstance.getId();

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

        Environment env = 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,
                                         kbase1,
                                         null,
                                         env );

        processInstance = (RuleFlowProcessInstance) service.getProcessInstance( processInstanceId );
        assertNotNull( processInstance );

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals( 1,
                      nodeInstances.size() );
        SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) nodeInstances.iterator().next();
        long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
        RuleFlowProcessInstance subProcessInstance = (RuleFlowProcessInstance) service.getProcessInstance( subProcessInstanceId );
        assertNotNull( subProcessInstance );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
View Full Code Here


        StatefulKnowledgeSession service = (StatefulKnowledgeSession) ctx.getBean( "jpaSingleSessionCommandService" );

        int sessionId = service.getId();

        RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) service.startProcess( "org.drools.test.ProcessSubProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );
        long processInstanceId = processInstance.getId();

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

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

        KnowledgeStoreService kstore = (KnowledgeStoreService) ctx.getBean( "kstore1" );
        KnowledgeBase kbase1 = (KnowledgeBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadStatefulKnowledgeSession( sessionId,
                                                       kbase1,
                                                       null,
                                                       env );

        processInstance = (RuleFlowProcessInstance) service.getProcessInstance( processInstanceId );
        assertNotNull( processInstance );

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals( 1,
                      nodeInstances.size() );
        SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) nodeInstances.iterator().next();
        long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
        RuleFlowProcessInstance subProcessInstance = (RuleFlowProcessInstance) service.getProcessInstance( subProcessInstanceId );
        assertNotNull( subProcessInstance );
        service.dispose();

        service = kstore.loadStatefulKnowledgeSession( sessionId,
                                                       kbase1,
View Full Code Here

        StatefulKnowledgeSession service = (StatefulKnowledgeSession) ctx.getBean( "jpaSingleSessionCommandService" );

        int sessionId = service.getId();

        RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) service.startProcess( "org.drools.test.ProcessSubProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );
        long processInstanceId = processInstance.getId();

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

        final Environment env = (Environment) ctx.getBean("env");
        /*Environment env = KnowledgeBaseFactory.newEnvironment();
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );
        */
        KnowledgeStoreService kstore = (KnowledgeStoreService) ctx.getBean( "kstore1" );
        KnowledgeBase kbase1 = (KnowledgeBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadStatefulKnowledgeSession( sessionId,
                                                       kbase1,
                                                       null,
                                                       env );

        processInstance = (RuleFlowProcessInstance) service.getProcessInstance( processInstanceId );
        assertNotNull( processInstance );

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals( 1,
                      nodeInstances.size() );
        SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) nodeInstances.iterator().next();
        long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
        RuleFlowProcessInstance subProcessInstance = (RuleFlowProcessInstance) service.getProcessInstance( subProcessInstanceId );
        assertNotNull( subProcessInstance );
        service.dispose();

        service = kstore.loadStatefulKnowledgeSession( sessionId,
                                                       kbase1,
View Full Code Here

        StatefulKnowledgeSession service = (StatefulKnowledgeSession) ctx.getBean( "jpaSingleSessionCommandService" );

        int sessionId = service.getId();

        RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) service.startProcess( "org.drools.test.ProcessSubProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );
        long processInstanceId = processInstance.getId();

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

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

        KnowledgeStoreService kstore = (KnowledgeStoreService) ctx.getBean( "kstore1" );
        KnowledgeBase kbase1 = (KnowledgeBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadStatefulKnowledgeSession( sessionId,
                                                       kbase1,
                                                       null,
                                                       env );

        processInstance = (RuleFlowProcessInstance) service.getProcessInstance( processInstanceId );
        assertNotNull( processInstance );

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals( 1,
                      nodeInstances.size() );
        SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) nodeInstances.iterator().next();
        long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
        RuleFlowProcessInstance subProcessInstance = (RuleFlowProcessInstance) service.getProcessInstance( subProcessInstanceId );
        assertNotNull( subProcessInstance );
        service.dispose();

        service = kstore.loadStatefulKnowledgeSession( sessionId,
                                                       kbase1,
View Full Code Here

        KieSession service = (KieSession) ctx.getBean( "jpaSingleSessionCommandService" );

        int sessionId = service.getId();

        RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) service.startProcess( "org.drools.test.ProcessSubProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );
        long processInstanceId = processInstance.getId();

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

        Environment env = 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,
                                         kbase1,
                                         null,
                                         env );

        processInstance = (RuleFlowProcessInstance) service.getProcessInstance( processInstanceId );
        assertNotNull( processInstance );

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals( 1,
                      nodeInstances.size() );
        SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) nodeInstances.iterator().next();
        long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
        RuleFlowProcessInstance subProcessInstance = (RuleFlowProcessInstance) service.getProcessInstance( subProcessInstanceId );
        assertNotNull( subProcessInstance );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
View Full Code Here

    public void testPersistenceSubProcess() {
        KieSession service = (KieSession) ctx.getBean( "jpaSingleSessionCommandService" );

        int sessionId = service.getId();

        RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) service.startProcess( "org.drools.test.ProcessSubProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );
        long processInstanceId = processInstance.getId();

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

        final Environment env = (Environment) ctx.getBean( "env" );
        /*Environment env = 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,
                                         kbase1,
                                         null,
                                         env );

        processInstance = (RuleFlowProcessInstance) service.getProcessInstance( processInstanceId );
        assertNotNull( processInstance );

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals( 1,
                      nodeInstances.size() );
        SubProcessNodeInstance subProcessNodeInstance = (SubProcessNodeInstance) nodeInstances.iterator().next();
        long subProcessInstanceId = subProcessNodeInstance.getProcessInstanceId();
        RuleFlowProcessInstance subProcessInstance = (RuleFlowProcessInstance) service.getProcessInstance( subProcessInstanceId );
        assertNotNull( subProcessInstance );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
View Full Code Here

TOP

Related Classes of org.jbpm.ruleflow.instance.RuleFlowProcessInstance

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.