Groovy Rule
A groovy rule runs a snippet of groovy code that returns true if error messages should be displayed in PDX UI.
The groovy rule builder has the following additional properties:
METHOD(s) | DESCRIPTION |
---|---|
|
Regarding parsing, see note below table. |
| A list of valid groovy variable names that are used in groovy snippet to refer to the value of the attribute with the given attribute ID |
| A list of aliases for the attributes that should display error message in PDX UI |
| The error message that will show up in PDX UI on the error attributes if groovy snippet returns true |
When groovy code is added via one of the three methods, it is automatically processed as follows:
code is compacted into a single line (remember to add semi-colons so that the code still compiles)
package and line containing predefined imports of BusinessRuleUtils and GroovyExecutionScope are removed
comment lines using // are removed
GroovyExecutionScope.SOME_FIELD is replaced by the internal groovy code, it represents, e.g. GroovyExecutionScope.CHANNEL_PRODUCT becomes context.get(“CHANNEL_PRODUCT”)
required contexts are automatically detected - see JSON result under Business rule implementation (WIP) | File based rule , where “CHANNEL_PRODUCT” was picked up
Updated 27 days ago