public WorkflowParser checkNoErrors() { issues.checkNoErrors(); return this; }
@Override public Deployment checkNoErrorsAndNoWarnings() { super.checkNoErrorsAndNoWarnings(); return this; } }
/** throws a RuntimeException if there were errors or warnings while deploying the process */ public ParseIssues checkNoErrorsAndNoWarnings() { checkNoIssues(true); return this; }
public boolean hasErrors() { if (hasIssues()) { for (ParseIssue issue: issues) { if (ParseIssue.IssueType.error==issue.type) { return true; } } } return false; }
public String getIssueReport() { return getIssueReport(null); }
public void addError(String message, Object... messageArgs) { ParseContext currentContext = contextStack.peek(); issues.addIssue(IssueType.error, getPathText(), currentContext.getLine(), currentContext.getColumn(), message, messageArgs); }
public Deployment(WorkflowId workflowId, ParseIssues parseIssues) { this.workflowId = workflowId; this.issues = parseIssues.getIssues(); }
public boolean hasErrors() { return issues.hasErrors(); }
public WorkflowParser(Configuration configuration) { this.configuration = configuration; this.path = new LinkedList<>(); this.contextStack = new Stack<>(); this.issues = new ParseIssues(); // this cast is necessary to get the workflow parse listener optional // because the brewery.getOpt method is not available on the configuration itself if (configuration instanceof DefaultConfiguration) { DefaultConfiguration defaultConfiguration = (DefaultConfiguration)configuration; Brewery brewery = defaultConfiguration.getBrewery(); this.workflowParseListener = brewery.getOpt(WorkflowParseListener.class); } }
public boolean hasErrors() { if (hasIssues()) { for (ParseIssue issue: issues) { if (ParseIssue.IssueType.error==issue.type) { return true; } } } return false; }
public String getIssueReport() { return getIssueReport(null); }
public void addWarning(String message, Object... messageArgs) { ParseContext currentContext = contextStack.peek(); issues.addIssue(IssueType.warning, getPathText(), currentContext.getLine(), currentContext.getColumn(), message, messageArgs); }
public Deployment(WorkflowId workflowId, ParseIssues parseIssues) { this.workflowId = workflowId; this.issues = parseIssues.getIssues(); }
@Override public Deployment checkNoErrors() { super.checkNoErrors(); return this; }
@Override public Deployment checkNoErrorsAndNoWarnings() { super.checkNoErrorsAndNoWarnings(); return this; } }
public String getIssueReport(Locale l) { if (hasIssues()) { StringBuilder issueReport = new StringBuilder(); issueReport.append("Issues: \n"); for (ParseIssue issue: issues) { issueReport.append(issue.toString()); issueReport.append("\n"); } return issueReport.toString(); } return null; }
/** throws a RuntimeException if there were errors deploying the process */ public ParseIssues checkNoErrors() { checkNoIssues(false); return this; }
protected void checkNoIssues(boolean throwIfWarning) { if (issues!=null) { for (ParseIssue issue: issues) { if (issue.type==ParseIssue.IssueType.error || throwIfWarning) { throw new RuntimeException(getIssueReport()); } } } }
@Override public Deployment checkNoErrors() { super.checkNoErrors(); return this; }
public WorkflowParser checkNoErrorsAndNoWarnings() { issues.checkNoErrorsAndNoWarnings(); return this; }