Expression evaluator

The DefaultEXPEvaluator class provides the implementation of Expression evaluator component. This class exposes the following APIs:
  • public HashMap<String, Serializable> evaluateExpressions(HashMap<String, String> expressions, Serializable inputData) - This API provides functionality of evaluating a set of expressions in a batch. The API accepts a collection of expressions and input data required to evaluate these expressions and returns a collection of expression results. The input expressions are provided as a map where each expression is mapped against a unique key. The result of API returns a map containing result of the expression mapped to the key of corresponding expression. If evaluation of any expression fails, that expression is not added to the result set. However other expressions are evaluated and their values are added to the result set.

  • public Serializable evaluateExpression(String expression, Serializable inputData) - This API is used to evaluate a single expression. The API expects an expression and the input data required to evaluate this expression and returns the computed value of expression.

  • public void validateExpression(String expression) - This API validates the syntax of expression. The API throws Exception if expression syntax is invalid.

Configure the following properties for this bean:
  • variableResolver - This property maps to a bean capable of resolving variables used in expressions by the expression evaluation library.

  • functionMapper - This property maps to a bean capable of resolving function references in expressions to actual invoke-able functions.

// Ethnio survey code removed