use of org.camunda.bpm.engine.impl.el.Expression in project camunda-bpm-platform by camunda.
the class ParseUtil method parseRetryIntervals.
public static FailedJobRetryConfiguration parseRetryIntervals(String retryIntervals) {
if (retryIntervals != null && !retryIntervals.isEmpty()) {
if (StringUtil.isExpression(retryIntervals)) {
ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();
Expression expression = expressionManager.createExpression(retryIntervals);
return new FailedJobRetryConfiguration(expression);
}
String[] intervals = StringUtil.split(retryIntervals, ",");
int retries = intervals.length + 1;
if (intervals.length == 1) {
try {
DurationHelper durationHelper = new DurationHelper(intervals[0]);
if (durationHelper.isRepeat()) {
retries = durationHelper.getTimes();
}
} catch (Exception e) {
LOG.logParsingRetryIntervals(intervals[0], e);
return null;
}
}
return new FailedJobRetryConfiguration(retries, Arrays.asList(intervals));
} else {
return null;
}
}
Aggregations