Package org.apache.commons.scxml.model

Examples of org.apache.commons.scxml.model.Parallel


        List t = s.getTransitionsList();
        for (int i = 0; i < t.size(); i++) {
            Transition trn = (Transition) t.get(i);
            updateTransition(trn, targets);
        }
        Parallel p = s.getParallel(); //TODO: Remove in v1.0
        Invoke inv = s.getInvoke();
        if ((inv != null && p != null)
                || (inv != null && !c.isEmpty())
                || (p != null && !c.isEmpty())) {
            logAndThrowModelError(ERR_STATE_BAD_CONTENTS,
View Full Code Here


        TransitionTarget lca = SCXMLHelper.getLCA((TransitionTarget)
            tts.get(0), (TransitionTarget) tts.get(1));
        if (lca == null || !(lca instanceof Parallel)) {
            return false; // Must have a Parallel LCA
        }
        Parallel p = (Parallel) lca;
        Set regions = new HashSet();
        for (int i = 0; i < tts.size(); i++) {
            TransitionTarget tt = (TransitionTarget) tts.get(i);
            while (tt.getParent() != p) {
                tt = tt.getParent();
            }
            if (!regions.add(tt)) {
                return false; // One per region
            }
        }
        if (regions.size() != p.getChildren().size()) {
            return false; // Must represent all regions
        }
        return true;
    }
View Full Code Here

        serializeOnEntry(b, s, indent + INDENT);
        List t = s.getTransitionsList();
        for (int i = 0; i < t.size(); i++) {
            serializeTransition(b, (Transition) t.get(i), indent + INDENT);
        }
        Parallel p = s.getParallel(); //TODO: Remove in v1.0
        Invoke inv = s.getInvoke();
        if (p != null) {
            serializeParallel(b, p, indent + INDENT);
        } else if (inv != null) {
            serializeInvoke(b , inv, indent + INDENT);
View Full Code Here

        assertTrue(SCXMLHelper.isLegalConfig(states, new SimpleErrorReporter()));
    }
   
    public void testIsLegalConfigInvalidParallel() {
        Set states = new HashSet();
        Parallel parallel = new Parallel();

        Parallel parent = new Parallel();
        parent.setId("4");

        State state1 = new State();
        state1.setId("1");
        State state2 = new State();
        state2.setId("2");
       
        parent.addChild(state1);
        parent.addChild(state2);
       
        parallel.setParent(parent);
       
        states.add(parallel);
       
View Full Code Here

        assertEquals(1, comparator.compare(target2, target1)); // reversed
    }
   
    public void testComparatorSameParent() {
        State target1 = new State();
        Parallel parent = new Parallel();
        target1.setParent(parent);
        parent.addChild(target1);
       
        State target2 = new State();
        target2.setParent(parent);
        parent.addChild(target2);
       
        assertEquals(1, comparator.compare(target1, target2));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.scxml.model.Parallel

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.