Class ExpressionTransformer
java.lang.Object
io.camunda.zeebe.engine.processing.deployment.model.transformer.ExpressionTransformer
Utility class to help with transforming expressions from strings to objects (i.e. parsing) and
from objects to strings (i.e. serializing).
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
asFeelExpressionString
(String expression) Transforms an expression string into a FEEL expression string.static String
asListLiteral
(List<String> values) Serializes a list of strings to a list-literal, e.g.static String
asStringLiteral
(String value) Transforms a string value to a string literal, e.g.parseListOfCsv
(String value) Parses a static value as a list of CSV, trimming any whitespace.
-
Method Details
-
parseListOfCsv
Parses a static value as a list of CSV, trimming any whitespace.- Parameters:
value
- the static value to parse- Returns:
- either a failure or a list of values (trimmed)
-
asListLiteral
Serializes a list of strings to a list-literal, e.g.List.of("a","b") => "[\"a\",\"b\"]"
.- Parameters:
values
- the list of string values to transform- Returns:
- a string representation of the list literal
-
asStringLiteral
Transforms a string value to a string literal, e.g."a" => "\"a\""
.- Parameters:
value
- the string value to transform- Returns:
- a string representation of the string literal
-
asFeelExpressionString
Transforms an expression string into a FEEL expression string.Zeebe considers strings starting with `=` as FEEL expressions, and other strings as static values. For example, `author` is considered a static value `author`, while `= author` is considered a FEEL expression that evaluates to the value of the variable `author`.
- Parameters:
expression
- The actual expression string to convert into a FEEL expression- Returns:
- The provided expression string prefixed by the `=` character
-