/** * Deduce input transitions from output transitions. */ protected void computeTransitions() throws DocumentRouteException { for (GraphNode node : nodes) { List<Transition> tt = node.getOutputTransitions(); for (Transition t : tt) { GraphNode target = getNode(t.target); target.initAddInputTransition(t); } } }
for (Transition t : getNode(nodeId).getOutputTransitions()) { children.add(t.target); if (done.add(nodeId)) { int source = ordering.get(nodeId).intValue(); for (Transition t : getNode(nodeId).getOutputTransitions()) { todo.push(t.target);
public static Map<String, Object> getGraphElementsAsMap(GraphRoute route, Locale locale) { Map<String, Object> graph = new HashMap<String, Object>(); List<NodeView> nodeViews = new ArrayList<NodeView>(); List<TransitionView> tranViews = new ArrayList<TransitionView>(); for (GraphNode node : route.getNodes()) { nodeViews.add(new NodeView(node, locale)); List<Transition> transitions = node.getOutputTransitions(); for (Transition transition : transitions) { GraphNode targetNode = route.getNode(transition.getTarget()); tranViews.add(new TransitionView(node.getId(), targetNode.getId(), transition, locale)); } } graph.put("nodes", nodeViews); graph.put("transitions", tranViews); return graph; }