Package org.drools.workflow.instance.node

Examples of org.drools.workflow.instance.node.StateNodeInstance


                    }
                    ((CompositeContextNodeInstance) nodeInstance).internalSetTimerInstances(timerInstances);
                }
                break;
            case PersisterEnums.STATE_NODE_INSTANCE:
                nodeInstance = new StateNodeInstance();
                nbTimerInstances = stream.readInt();
                if (nbTimerInstances > 0) {
                    List<Long> timerInstances = new ArrayList<Long>();
                    for (int i = 0; i < nbTimerInstances; i++) {
                        timerInstances.add(stream.readLong());
View Full Code Here


                    }
                    ((CompositeContextNodeInstance) nodeInstance).internalSetTimerInstances(timerInstances);
                }
                break;
            case PersisterEnums.STATE_NODE_INSTANCE:
                nodeInstance = new StateNodeInstance();
                nbTimerInstances = stream.readInt();
                if (nbTimerInstances > 0) {
                    List<Long> timerInstances = new ArrayList<Long>();
                    for (int i = 0; i < nbTimerInstances; i++) {
                        timerInstances.add(stream.readLong());
View Full Code Here

            workingMemory.startProcess("org.drools.state");
        // should be in state A
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        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,
        // 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
        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
        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
        processInstance.signalEvent("signal", "End");
        nodeInstances = processInstance.getNodeInstances();
        assertEquals(0, nodeInstances.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
View Full Code Here

            workingMemory.startProcess("org.drools.state");
        // should be in state A
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        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();
View Full Code Here

            workingMemory.startProcess("org.drools.state");
        // should be in state A
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
        assertEquals(1, nodeInstances.size());
        StateNodeInstance stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
        assertEquals("State", stateInstance.getNodeName());
        assertEquals(0, list.size());
        try {
      Thread.sleep(4000);
    } catch (InterruptedException e) {
    }
View Full Code Here

                    }
                    ((CompositeContextNodeInstance) nodeInstance).internalSetTimerInstances(timerInstances);
                }
                break;
            case PersisterEnums.STATE_NODE_INSTANCE:
                nodeInstance = new StateNodeInstance();
                nbTimerInstances = stream.readInt();
                if (nbTimerInstances > 0) {
                    List<Long> timerInstances = new ArrayList<Long>();
                    for (int i = 0; i < nbTimerInstances; i++) {
                        timerInstances.add(stream.readLong());
View Full Code Here

                break;
            case PersisterEnums.FOR_EACH_NODE_INSTANCE:
                nodeInstance = new ForEachNodeInstance();
                break;
            case PersisterEnums.STATE_NODE_INSTANCE:
                nodeInstance = new StateNodeInstance();
                nbTimerInstances = stream.readInt();
                if (nbTimerInstances > 0) {
                    List<Long> timerInstances = new ArrayList<Long>();
                    for (int i = 0; i < nbTimerInstances; i++) {
                        timerInstances.add(stream.readLong());
View Full Code Here

TOP

Related Classes of org.drools.workflow.instance.node.StateNodeInstance

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.