public static DirectedAcyclicGraph<Op, DefaultEdge> convert(Op op) { DirectedAcyclicGraph<Op, DefaultEdge> result = new DirectedAcyclicGraph<Op, DefaultEdge>(DefaultEdge.class); result.addVertex(op); convert(op, result); return result; }
public static DirectedAcyclicGraph<Op, DefaultEdge> convert(Op op) { DirectedAcyclicGraph<Op, DefaultEdge> result = new DirectedAcyclicGraph<Op, DefaultEdge>(DefaultEdge.class); result.addVertex(op); convert(op, result); return result; }
public static void convert(Op op, DirectedAcyclicGraph<Op, DefaultEdge> result) { List<Op> children = OpUtils.getSubOps(op); for(Op child : children) { result.addVertex(child); result.addEdge(op, child); convert(child, result); } }
public static void convert(Op op, DirectedAcyclicGraph<Op, DefaultEdge> result) { List<Op> children = OpUtils.getSubOps(op); for(Op child : children) { result.addVertex(child); result.addEdge(op, child); convert(child, result); } }
private static Work[] getSetVariableValuesOrdered(BaseElement element) { Work[] values = setVariablePropertyCache.get(element); if (values == null) { String[] expressions = DemoModelInstrumentator.readCamundaPropertyMulti(element, "simulateSetVariable").toArray(new String[] {}); values = new Work[expressions.length]; DirectedAcyclicGraph<Work, Object> graph = new DirectedAcyclicGraph<>(Object.class); for (int i = 0; i < expressions.length; i++) { values[i] = new Work(expressions[i]); graph.addVertex(values[i]); } for (Work currentWork : values) { for (Work otherWork : values) { if (currentWork.valueExpression.matches(".*\\W" + Pattern.quote(otherWork.variableExpression) + "\\W.*")) { try { graph.addEdge(otherWork, currentWork); } catch (IllegalArgumentException e) { LOG.warn("Possible cycle in simulateSetVariable-dependencies detected when checking '{}'", currentWork.valueExpression); } } } } int i = 0; for (Iterator<Work> iterator = graph.iterator(); iterator.hasNext();) { Work next = iterator.next(); values[i++] = next; } setVariablePropertyCache.put(element, values); } return values; }