java.lang.Object
io.camunda.zeebe.engine.processing.deployment.model.transformer.ExpressionTransformer

public final class ExpressionTransformer extends Object
Utility class to help with transforming expressions from strings to objects (i.e. parsing) and from objects to strings (i.e. serializing).
  • Method Details

    • parseListOfCsv

      public static Either<Failure,List<String>> parseListOfCsv(String value)
      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

      public static String asListLiteral(List<String> values)
      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

      public static String asStringLiteral(String value)
      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

      public static String asFeelExpressionString(String expression)
      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