/** * Returns the name of the event without evaluating the possible expression that it might contain. */ public String getUnresolvedEventName() { return eventName.getExpressionText(); }
/** * Resolves the event name within the given scope. */ public String resolveExpressionOfEventName(VariableScope scope) { if (isExpressionAvailable()) { return (String) eventName.getValue(scope); } else { return null; } }
public boolean isEventNameLiteralText() { return eventName.isLiteralText(); }
/** * Returns the name of the event without evaluating the possible expression that it might contain. */ public String getUnresolvedEventName() { return eventName.getExpressionText(); }
/** * Resolves the event name within the given scope. */ public String resolveExpressionOfEventName(VariableScope scope) { if (isExpressionAvailable()) { return (String) eventName.getValue(scope); } else { return null; } }
public boolean isEventNameLiteralText() { return eventName.isLiteralText(); }
public String getName() { return name.getExpressionText(); }
public Object getValue(VariableScope variableScope) { EnsureUtil.ensureNotNull("variableScope", variableScope); return expression.getValue(variableScope); }
/** * Checks whether a {@link String} seams to be a composite expression or not. In contrast to an eval expression * is the composite expression also allowed to consist of a combination of literal and eval expressions, e.g., * "Welcome ${customer.name} to our site". * * Note: If you just want to allow eval expression, then the expression must always start with "#{" or "${". * Use {@link #isExpression(String)} to conduct these kind of checks. * */ public static boolean isCompositeExpression(String text, ExpressionManager expressionManager) { return !expressionManager.createExpression(text).isLiteralText(); }
public String getName() { return name.getExpressionText(); }
public Object getValue(VariableScope variableScope) { EnsureUtil.ensureNotNull("variableScope", variableScope); return expression.getValue(variableScope); }
/** * Checks whether a {@link String} seams to be a composite expression or not. In contrast to an eval expression * is the composite expression also allowed to consist of a combination of literal and eval expressions, e.g., * "Welcome ${customer.name} to our site". * * Note: If you just want to allow eval expression, then the expression must always start with "#{" or "${". * Use {@link #isExpression(String)} to conduct these kind of checks. * */ public static boolean isCompositeExpression(String text, ExpressionManager expressionManager) { return !expressionManager.createExpression(text).isLiteralText(); }
@Override public int compareTo(ElValueProvider o) { return expression.getExpressionText().compareTo(o.getExpression().getExpressionText()); }
@Override public boolean evaluate(VariableScope scope, DelegateExecution execution) { Object result = expression.getValue(scope, execution); ensureNotNull("condition expression returns null", "result", result); ensureInstanceOf("condition expression returns non-Boolean", "result", result, Boolean.class); return (Boolean) result; }
public boolean isEventNameLiteralText() { return eventName.isLiteralText(); }
@Override public int compareTo(ElValueProvider o) { return expression.getExpressionText().compareTo(o.getExpression().getExpressionText()); }
@Override public boolean evaluate(VariableScope scope, DelegateExecution execution) { Object result = expression.getValue(scope, execution); ensureNotNull("condition expression returns null", "result", result); ensureInstanceOf("condition expression returns non-Boolean", "result", result, Boolean.class); return (Boolean) result; }
/** * Checks whether a {@link String} seams to be a composite expression or not. In contrast to an eval expression * is the composite expression also allowed to consist of a combination of literal and eval expressions, e.g., * "Welcome ${customer.name} to our site". * * Note: If you just want to allow eval expression, then the expression must always start with "#{" or "${". * Use {@link #isExpression(String)} to conduct these kind of checks. * */ public static boolean isCompositeExpression(String text, ExpressionManager expressionManager) { return !expressionManager.createExpression(text).isLiteralText(); }
/** * Returns the name of the event without evaluating the possible expression that it might contain. */ public String getUnresolvedEventName() { return eventName.getExpressionText(); }
protected String getFailedJobRetryTimeCycle(JobEntity job, Expression expression) { String executionId = job.getExecutionId(); ExecutionEntity execution = null; if (executionId != null) { execution = fetchExecutionEntity(executionId); } Object value = null; if (expression == null) { return null; } try { value = expression.getValue(execution, execution); } catch (Exception e) { LOG.exceptionWhileParsingExpression(jobId, e.getCause().getMessage()); } if (value instanceof String) { return (String) value; } else { // default behavior return null; } }