@Test void testEmptyPackageName() { RuleFlowProcess process = new RuleFlowProcess(); process.setId("org.drools.core.process"); process.setName("Empty Package Name Process"); process.setPackageName(""); process.setDynamic(true); ProcessValidationError[] errors = validator.validateProcess(process); assertNotNull(errors); assertEquals(0, errors.length); }
public ProcessValidationError[] validateProcess(final RuleFlowProcess process) { final List<ProcessValidationError> errors = new ArrayList<>(); if (process.getName() == null) { errors.add(new ProcessValidationErrorImpl(process, "Process has no name.")); } if (process.getId() == null || "".equals(process.getId())) { errors.add(new ProcessValidationErrorImpl(process, "Process has no id.")); } if (process.getStartNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no start node.")); } if (process.getEndNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no end node.")); } validateNodes(process.getNodes(), errors, process); validateVariables(errors, process); checkAllNodesConnectedToStart(process, process.isDynamic(), errors, process); return errors.toArray(new ProcessValidationError[errors.size()]); }
RuleFlowProcessValidator implements ProcessValidator { public ProcessValidationError[] validateProcess(final RuleFlowProcess process) { final List<ProcessValidationError> errors = new ArrayList<>(); if (process.getName() == null) { errors.add(new ProcessValidationErrorImpl(process, "Process has no name.")); } if (process.getId() == null || "".equals(process.getId())) { errors.add(new ProcessValidationErrorImpl(process, "Process has no id.")); } if (process.getStartNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no start node.")); } if (process.getEndNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no end node.")); } validateNodes(process.getNodes(), errors, process); validateVariables(errors, process); checkAllNodesConnectedToStart(process, process.isDynamic(), errors, process); return errors.toArray(new ProcessValidationError[errors.size()]); } }
RuleFlowProcessValidator implements ProcessValidator { public ProcessValidationError[] validateProcess(final RuleFlowProcess process) { final List<ProcessValidationError> errors = new ArrayList<>(); if (process.getName() == null) { errors.add(new ProcessValidationErrorImpl(process, "Process has no name.")); } if (process.getId() == null || "".equals(process.getId())) { errors.add(new ProcessValidationErrorImpl(process, "Process has no id.")); } if (process.getStartNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no start node.")); } if (process.getEndNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no end node.")); } validateNodes(process.getNodes(), errors, process); validateVariables(errors, process); checkAllNodesConnectedToStart(process, process.isDynamic(), errors, process); return errors.toArray(new ProcessValidationError[errors.size()]); } private  RuleFlowProcessValidator(); }
RuleFlowProcessValidator implements ProcessValidator { public ProcessValidationError[] validateProcess(final RuleFlowProcess process) { final List<ProcessValidationError> errors = new ArrayList<>(); if (process.getName() == null) { errors.add(new ProcessValidationErrorImpl(process, "Process has no name.")); } if (process.getId() == null || "".equals(process.getId())) { errors.add(new ProcessValidationErrorImpl(process, "Process has no id.")); } if (process.getStartNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no start node.")); } if (process.getEndNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no end node.")); } validateNodes(process.getNodes(), errors, process); validateVariables(errors, process); checkAllNodesConnectedToStart(process, process.isDynamic(), errors, process); return errors.toArray(new ProcessValidationError[errors.size()]); } private  RuleFlowProcessValidator(); static RuleFlowProcessValidator getInstance(); ProcessValidationError[] validateProcess(final RuleFlowProcess process); ProcessValidationError[] validateProcess(Process process); @Override boolean accept(Process process,
                          Resource resource); @Override boolean compilationSupported(); }
RuleFlowProcessValidator implements ProcessValidator { public ProcessValidationError[] validateProcess(final RuleFlowProcess process) { final List<ProcessValidationError> errors = new ArrayList<>(); if (process.getName() == null) { errors.add(new ProcessValidationErrorImpl(process, "Process has no name.")); } if (process.getId() == null || "".equals(process.getId())) { errors.add(new ProcessValidationErrorImpl(process, "Process has no id.")); } if (process.getStartNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no start node.")); } if (process.getEndNodes().isEmpty() && !process.isDynamic()) { errors.add(new ProcessValidationErrorImpl(process, "Process has no end node.")); } validateNodes(process.getNodes(), errors, process); validateVariables(errors, process); checkAllNodesConnectedToStart(process, process.isDynamic(), errors, process); return errors.toArray(new ProcessValidationError[errors.size()]); } private  RuleFlowProcessValidator(); static RuleFlowProcessValidator getInstance(); ProcessValidationError[] validateProcess(final RuleFlowProcess process); ProcessValidationError[] validateProcess(Process process); @Override boolean accept(Process process,
                          Resource resource); @Override boolean compilationSupported(); static final String ASSOCIATIONS; }