Class FeelEngineWrapper
java.lang.Object
io.camunda.connector.runtime.util.feel.FeelEngineWrapper
Wrapper for the FEEL engine, handling type conversions and expression evaluations.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor, creating anObjectMapperand aFeelEnginewith default configuration.FeelEngineWrapper(org.camunda.feel.FeelEngine feelEngine, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Injection constructor allowing to pass in theFeelEngineandObjectMapperto use. -
Method Summary
-
Constructor Details
-
FeelEngineWrapper
public FeelEngineWrapper()Default constructor, creating anObjectMapperand aFeelEnginewith default configuration. -
FeelEngineWrapper
public FeelEngineWrapper(org.camunda.feel.FeelEngine feelEngine, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Injection constructor allowing to pass in theFeelEngineandObjectMapperto use.- Parameters:
feelEngine- the FEEL engine to useobjectMapper- the object mapper to use
-
-
Method Details
-
evaluate
Evaluates an expression with the FEEL engine with the given variables.- Type Parameters:
T- the type to cast the evaluation result to- Parameters:
expression- the expression to evaluatevariables- the variables to use in evaluation- Returns:
- the evaluation result
- Throws:
FeelEngineWrapperException- when there is an exception message as a result of the evaluation or the result cannot be cast to the given type
-
evaluateToJson
Evaluates an expression to a JSON String.- Parameters:
expression- the expression to evaluatevariables- the variables to use in evaluation- Returns:
- the JSON String representing the evaluation result
- Throws:
FeelEngineWrapperException- when there is an exception message as a result of the evaluation or the result cannot be parsed as JSON
-