Examples of startProcess()


Examples of org.drools.StatefulSession.startProcess()

        StatefulSession session = ruleBase.newStatefulSession();
        TestWorkItemHandler handler = new TestWorkItemHandler();
        session.getWorkItemManager().registerWorkItemHandler("Email", handler);
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("myVariable", "ThisIsMyValue");
        session.startProcess("org.test.ruleflow", variables);

        assertEquals(1, session.getProcessInstances().size());
        assertTrue(handler.getWorkItem() != null);
       
        session = getSerialisedStatefulSession( session );
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

        StatefulSession session = ruleBase.newStatefulSession();
        TestWorkItemHandler handler1 = new TestWorkItemHandler();
        session.getWorkItemManager().registerWorkItemHandler("Log", handler1);
        TestWorkItemHandler handler2 = new TestWorkItemHandler();
        session.getWorkItemManager().registerWorkItemHandler("Human Task", handler2);
        session.startProcess("com.sample.ruleflow");

        assertEquals(2, session.getProcessInstances().size());
        assertTrue(handler1.getWorkItem() != null);
        long workItemId = handler2.getWorkItem().getId();
        assertTrue(workItemId != -1);
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

        list.add("one");
        list.add("two");
        list.add("three");
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("list", list);
        session.startProcess("com.sample.ruleflow", parameters);

        assertEquals(1, session.getProcessInstances().size());
        assertEquals(3, handler.getWorkItems().size());
       
        session = getSerialisedStatefulSession( session );
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

      public void run() {
            session.fireUntilHalt();        
      }
        }).start();
   
        session.startProcess("com.sample.ruleflow", null);

        assertEquals(1, session.getProcessInstances().size());
        session.halt();
       
        final StatefulSession session2 = getSerialisedStatefulSession( session );
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

      public void run() {
            session.fireUntilHalt();        
      }
        }).start();
   
        session.startProcess("com.sample.ruleflow", null);
        assertEquals(1, session.getProcessInstances().size());
       
        StatefulKnowledgeSession ksession = new StatefulKnowledgeSessionImpl( (ReteooWorkingMemory) session );
        Marshaller marshaller = MarshallerFactory.newMarshaller( ksession.getKnowledgeBase() );
    
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        StatefulSession session = ruleBase.newStatefulSession();
        ProcessInstance processInstance =
            session.startProcess("org.drools.event");
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals("MyValue", ((VariableScopeInstance)
        ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
    }
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

        builder.addRuleFlow(source);
        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        StatefulSession session = ruleBase.newStatefulSession();
        ProcessInstance processInstance = session.startProcess("org.drools.event");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
       
        session = SerializationHelper.getSerialisedStatefulSession(session);
        processInstance = session.getProcessInstance(processInstance.getId());
        processInstance.signalEvent("MyEvent", "MyValue");
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

        builder.addRuleFlow(source);
        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        StatefulSession session = ruleBase.newStatefulSession();
        ProcessInstance processInstance = session.startProcess("org.drools.event");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals("SomeText", ((VariableScopeInstance)
        ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
       
View Full Code Here

Examples of org.drools.StatefulSession.startProcess()

        builder.addRuleFlow(source);
        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        StatefulSession session = ruleBase.newStatefulSession();
        ProcessInstance processInstance = session.startProcess("org.drools.event");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals("SomeText", ((VariableScopeInstance)
        ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
View Full Code Here

Examples of org.drools.WorkingMemory.startProcess()

        workingMemory.fireAllRules();
        assertEquals( 0,
                      list.size() );

        final ProcessInstance processInstance = workingMemory.startProcess( "0" );
        assertEquals( ProcessInstance.STATE_ACTIVE,
                      processInstance.getState() );
        workingMemory.fireAllRules();
        assertEquals( 4,
                      list.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.