Examples of signalEvent()


Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

       
        ProcessInstance processInstance = ksession.startProcess("org.drools.process.event");
        assertEquals(0, myList.size());
        Person jack = new Person();
        jack.setName("Jack");
        processInstance.signalEvent("myEvent", jack);
        assertEquals(1, myList.size());
        Person john = new Person();
        john.setName("John");
        processInstance.signalEvent("myEvent", john);
        assertEquals(2, myList.size());
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

        jack.setName("Jack");
        processInstance.signalEvent("myEvent", jack);
        assertEquals(1, myList.size());
        Person john = new Person();
        john.setName("John");
        processInstance.signalEvent("myEvent", john);
        assertEquals(2, myList.size());
    }

    public void testEvent3() {
        RuleFlowProcess process = new RuleFlowProcess();
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

       
        ProcessInstance processInstance = ksession.startProcess("org.drools.process.event");
        assertEquals(0, myList.size());
        Person jack = new Person();
        jack.setName("Jack");
        processInstance.signalEvent("myEvent", jack);
        assertEquals(1, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        processInstance.signalEvent("myEvent", jack);
        assertEquals(2, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

        Person jack = new Person();
        jack.setName("Jack");
        processInstance.signalEvent("myEvent", jack);
        assertEquals(1, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        processInstance.signalEvent("myEvent", jack);
        assertEquals(2, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        Person john = new Person();
        john.setName("John");
        processInstance.signalEvent("myOtherEvent", john);
View Full Code Here

Examples of org.drools.runtime.process.WorkflowProcessInstance.signalEvent()

        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        StateNodeInstance stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateA", stateInstance.getNodeName());
        // signal "toB" so we move to state B
        processInstance.signalEvent("signal", "toB");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateB", stateInstance.getNodeName());
        // if no constraint specified for a connection,
View Full Code Here

Examples of org.drools.runtime.process.WorkflowProcessInstance.signalEvent()

        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateB", stateInstance.getNodeName());
        // if no constraint specified for a connection,
        // we default to the name of the target node
        // signal "StateA", so we move back to state A
        processInstance.signalEvent("signal", "StateA");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateA", stateInstance.getNodeName());
        // signal "toC" so we move to state C
View Full Code Here

Examples of org.drools.runtime.process.WorkflowProcessInstance.signalEvent()

        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateA", stateInstance.getNodeName());
        // signal "toC" so we move to state C
        processInstance.signalEvent("signal", "toC");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateC", stateInstance.getNodeName());
        // signal something completely wrong, this should simply be ignored
View Full Code Here

Examples of org.drools.runtime.process.WorkflowProcessInstance.signalEvent()

        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateC", stateInstance.getNodeName());
        // signal something completely wrong, this should simply be ignored
        processInstance.signalEvent("signal", "Invalid");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateC", stateInstance.getNodeName());
        // signal "End", so we move to the end
View Full Code Here

Examples of org.drools.runtime.process.WorkflowProcessInstance.signalEvent()

        nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("StateC", stateInstance.getNodeName());
        // signal "End", so we move to the end
        processInstance.signalEvent("signal", "End");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(0, nodeInstances.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
View Full Code Here

Examples of org.drools.runtime.process.WorkflowProcessInstance.signalEvent()

        StateNodeInstance stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("State", stateInstance.getNodeName());
        assertEquals(2, list.size());
        assertTrue(list.contains("Action1a"));
        assertTrue(list.contains("Action2a"));
        processInstance.signalEvent("signal", "End");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(0, nodeInstances.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals(4, list.size());
        assertTrue(list.contains("Action3a"));
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.