@Test(expected = IllegalArgumentException.class) public void testUpdateNewNodeName_UnhandledType() { DefaultValueUtilities.updateNewNodeName(graph, new LiteralExpression()); }
public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof NamedElement) { if (isNameAlreadySet((NamedElement) dmnModel)) { return; } } if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else if (dmnModel instanceof DecisionService) { updateDecisionServiceDefaultName(graph, (DecisionService) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } }
DefaultValueUtilities { public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof NamedElement) { if (isNameAlreadySet((NamedElement) dmnModel)) { return; } } if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else if (dmnModel instanceof DecisionService) { updateDecisionServiceDefaultName(graph, (DecisionService) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } } }
DefaultValueUtilities { public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof NamedElement) { if (isNameAlreadySet((NamedElement) dmnModel)) { return; } } if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else if (dmnModel instanceof DecisionService) { updateDecisionServiceDefaultName(graph, (DecisionService) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } }  }
DefaultValueUtilities { public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof NamedElement) { if (isNameAlreadySet((NamedElement) dmnModel)) { return; } } if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else if (dmnModel instanceof DecisionService) { updateDecisionServiceDefaultName(graph, (DecisionService) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } }  static void updateNewNodeName(final Graph<?, Node> graph,
                                         final DMNModelInstrumentedBase dmnModel); static Optional<Integer> extractIndex(final String text,
                                                 final String prefix); static int getMaxUnusedIndex(final Collection<String> values,
                                        final String prefix); }
DefaultValueUtilities { public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof NamedElement) { if (isNameAlreadySet((NamedElement) dmnModel)) { return; } } if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else if (dmnModel instanceof DecisionService) { updateDecisionServiceDefaultName(graph, (DecisionService) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } }  static void updateNewNodeName(final Graph<?, Node> graph,
                                         final DMNModelInstrumentedBase dmnModel); static Optional<Integer> extractIndex(final String text,
                                                 final String prefix); static int getMaxUnusedIndex(final Collection<String> values,
                                        final String prefix);  }