While testing correlation expressions with conditions, I would need this:
1) take account attribute and process it somehow, e.g. parse with regular expressions
2) based on the result, correlation conditions would apply
3) based on the condition, correlation expressions would be returned and user matched (or not)
If I want to match accounts using regular expressions and then decide how they should be matched with users, I need to "store" that regular expression, and the matcher result, unless I want to repeat the same matching in all conditions.
Real world scenario:
If account name contains employee number (6 digits), e.g. js123456, then correlate using $account/name == $user/employeeNumber.
else (if account name does not contain employee number), e.g. jsmith, then correlate using $account/name == $user/name (given that the naming convention for external users is like that).
To achieve this, I would need to repeate the same regular expression matching in both (all) conditions, and then in both (all) expressions, if the data is not shared between the Groovy script expressions.
Maybe a "preCorrelationExpression" could help, to prepare regexp, store the matching result and the matcher object to variables and then use it in the subsequent correlation conditions and expressions.