@Test public void testIsStageNode() { setupForStage(); assertTrue(CaseManagementCommandUtil.isStageNode(child)); }
public static boolean isStageNode(final Node<View<?>, Edge> node) { if (node.getContent().getDefinition() instanceof AdHocSubprocess) { final List<Node> childNodes = node.getOutEdges().stream() .filter(childPredicate()) .map(Edge::getTargetNode).collect(Collectors.toList()); return childNodes.isEmpty() || childNodes.stream().allMatch(CaseManagementCommandUtil::isSubStageNode); } return false; }
CaseManagementCommandUtil { public static boolean isStageNode(final Node<View<?>, Edge> node) { if (node.getContent().getDefinition() instanceof AdHocSubprocess) { final List<Node> childNodes = node.getOutEdges().stream() .filter(childPredicate()) .map(Edge::getTargetNode).collect(Collectors.toList()); return childNodes.isEmpty() || childNodes.stream().allMatch(CaseManagementCommandUtil::isSubStageNode); } return false; } }
CaseManagementCommandUtil { public static boolean isStageNode(final Node<View<?>, Edge> node) { if (node.getContent().getDefinition() instanceof AdHocSubprocess) { final List<Node> childNodes = node.getOutEdges().stream() .filter(childPredicate()) .map(Edge::getTargetNode).collect(Collectors.toList()); return childNodes.isEmpty() || childNodes.stream().allMatch(CaseManagementCommandUtil::isSubStageNode); } return false; }  }
CaseManagementCommandUtil { public static boolean isStageNode(final Node<View<?>, Edge> node) { if (node.getContent().getDefinition() instanceof AdHocSubprocess) { final List<Node> childNodes = node.getOutEdges().stream() .filter(childPredicate()) .map(Edge::getTargetNode).collect(Collectors.toList()); return childNodes.isEmpty() || childNodes.stream().allMatch(CaseManagementCommandUtil::isSubStageNode); } return false; }  @SuppressWarnings("unchecked") static Node<Definition<CaseManagementDiagram>, ?> getFirstDiagramNode(final Graph<?, Node> graph); @SuppressWarnings("unchecked") static int getChildGraphIndex(final Node parent,
                                         final Node child); @SuppressWarnings("unchecked") static int getChildCanvasIndex(final Node<View<?>, Edge> parent,
                                          final Node<View<?>, Edge> child); static boolean isStage(final Node<View<?>, Edge> parent, final Node<View<?>, Edge> child); static boolean isStageNode(final Node<View<?>, Edge> node); static boolean isSubStageNode(final Node<View<?>, Edge> node); static Predicate<Edge> childPredicate(); static Predicate<Edge> sequencePredicate(); @SuppressWarnings("unchecked") static int getNewChildCanvasIndex(final Node<View<?>, Edge> parent); @SuppressWarnings("unchecked") static int getNewChildGraphIndex(final Node<View<?>, Edge> parent); }
CaseManagementCommandUtil { public static boolean isStageNode(final Node<View<?>, Edge> node) { if (node.getContent().getDefinition() instanceof AdHocSubprocess) { final List<Node> childNodes = node.getOutEdges().stream() .filter(childPredicate()) .map(Edge::getTargetNode).collect(Collectors.toList()); return childNodes.isEmpty() || childNodes.stream().allMatch(CaseManagementCommandUtil::isSubStageNode); } return false; }  @SuppressWarnings("unchecked") static Node<Definition<CaseManagementDiagram>, ?> getFirstDiagramNode(final Graph<?, Node> graph); @SuppressWarnings("unchecked") static int getChildGraphIndex(final Node parent,
                                         final Node child); @SuppressWarnings("unchecked") static int getChildCanvasIndex(final Node<View<?>, Edge> parent,
                                          final Node<View<?>, Edge> child); static boolean isStage(final Node<View<?>, Edge> parent, final Node<View<?>, Edge> child); static boolean isStageNode(final Node<View<?>, Edge> node); static boolean isSubStageNode(final Node<View<?>, Edge> node); static Predicate<Edge> childPredicate(); static Predicate<Edge> sequencePredicate(); @SuppressWarnings("unchecked") static int getNewChildCanvasIndex(final Node<View<?>, Edge> parent); @SuppressWarnings("unchecked") static int getNewChildGraphIndex(final Node<View<?>, Edge> parent);  }