holunda-io/camunda-bpm-data

Provide a new ReGex VarablesGuard, to be able to easily validate String based types like E-Mails or UUIDs

Closed this issue · 1 comments

Scenario

  • camunda-bpm-data version: 1.2.4
  • Camunda BPM version: 7.15.6
  • Description of your use case: To test my variables I want to be able to use guard that uses a given regex.

Current Behavior

There is no dedicated guard for testing regular expressions

Workaround

Implement a guard using a more generic matches guard, with the limitation that the error message is not specific.

Wanted Behavior

Short written guards to validate variables with RegExes, with an optional violation message. If the message is omitted, the regex guard should print out the Regular Expression and the value that hasn't match it.

Example:

new DefaultGuardExecutionListener(List.of(
            regex(MY_VARIABLE, MY_EMAIL_REGEX, "variable value is not an E-Mail address")
        ), true);

closed by 5d095db