◷ Reading Time: 1 minute
Action
This command structures the columns of a Decision Table as an action. Action can be in two types:
- Notice: To write a notice in a notification (set type to notice)
- Or using any expressions directly (e.g., call a method, assign a value). See Expression. (leave type empty)
Parameters
- name
- Description: Represents the name of the column
- Mandatory: Yes
- Type: String
- type
- Description: type of action. If this is not set then expression should use the full evaluation expression. For more information check Expression
- Mandatory: No
- Type: Notice (Obsoleted values: Set, Call)
- expression
- Description: The expression template of an action or notices message
- Mandatory: When no ‘term’ is defined
- Type: String (Expression)
- term
- Description: Refers to a Glossary Term’s name
- Mandatory: When no ‘expression’ is defined
- Type: String (name of a term)
- variable
- Description: name of the variable that the expression targets
- Mandatory: Yes if the type is set
- Type: String (parameter name)
Notice Action
- notice (only valid when type is set to ‘Notice’ )
- Description: specifies the type of notice message
- Mandatory: No
- notification (When notice action)
- Description: Allows grouping notices in different categories
- Mandatory: No
- Type: string (no space is allowed)
- useMessageId (When notice action)
- Description: specifies the values for notice messages will be used as messageId
- Mandatory: No
- Type: bool (true/false)
Array
When Action applies on array, below parameters are required:
- onArray
- Description: reference to the parameter/expression that is the source of array/collection
- Mandatory: Yes
- Type: Parameter name or expression
- elementName
- Description: reference to each individual element on the array/collection
- Mandatory: Yes
- Type: Parameter name
Sample
Action with no type specified as an direct expression:
<Columns>
<Condition name="Min" expression="person.Age ge $value" />
<Condition name="Max" expression="person.Age le $value" />
<Action name="Title" expression="title = $value"/>
</Columns>
Action with type specified.
<Columns>
<Condition name="Min" expression="person.Age ge $value" />
<Condition name="Max" expression="person.Age le $value" />
<Action name="Title" expression="title" />
</Columns>
Action with type of ‘Notice’ to write messages using Notification
<Columns>
<Condition name="Product Exists?" expression="product.Found == $value" />
<Condition name="Points > 20" expression="((product.Quantity * product.Point) > 20)" />
<Action name="Error Message" expression="$value" type="Notice" />
<Action name="Success Message" expression="$value" type="Notice" notice="Information" />
</Columns>