Variable configuration
Rule variables are configured in the RULE VARIABLES section of the Rule Set.
A variable can be defined to store a temporary value and used in a rule condition to apply a computation or more advanced logic. See Variables for more information.
If you configure multiple values for a rule variable, it could be returned as a multi valued attribute (if all sources contribute a value). In the example below, the variable named VarDetails
can be multi-valued with one value coming from the source carLicense
attribute and one coming from source employeeNumber
.
- In the Rule Variables section, select the button to create a new variable.
- Enter a variable name.
- (Optional) To add a constant value for the variable, select next to Values, select the Constant option from the drop-down list and enter the value. Select OK and OK again to close the Edit Rule Variable window.
- (Optional) A value of a variable can come from another variable. This can be a source attribute value or from another variable that has been defined. Select next to Values, select the Attribute option from the drop-down list and then select the source attribute, or variable name from the drop-down list on the right. Select OK and OK again to close the Edit Rule Variable window.
- (Optional) To apply a function on a source attribute and store the computed value in a variable, select next to Values and select the Function option from the drop-down list. Select the Edit button, select a function from the available list and select Next. The configuration screen and options vary depending on the function selected. After the function is configured, select OK and OK again to close the Edit Rule Variable window.
- (Optional) To configure conditions that dictate how and when the rule variable is populated, select Start Condition.
- Variables can be used when defining rule conditions by selecting the Rule Variable Condition from the Condition Type drop-down list. After all variables are defined, select the RULES section.
Configure rule variable conditions
You can configure one or more conditions that dictate the context in which the variable is populated with the configured value(s).
- On the Rule Variables tab, select a variable and select Edit.
- Select Start Condition.
- If you want multiple conditions, select
AND
Condition, orOR
Condition. If you only need one condition, selectCondition Node
. - If you selected
Condition Node
in the previous step, choose the Condition Type from the drop-down list. For a description of condition types, see Variables. Based on the condition type selected, different settings are configurable. Your conditions can be a combination of different condition types. See Configure Source Attribute condition, Configure Source Event condition, Configure Attribute Event condition, and Configure Rule Variable condition for details.
If you need another condition after selecting Condition Node
(for one condition), select Add Parent Condition and choose either AND
Condition or OR
Condition. Then select
to add the new condition node (AND
Condition or OR
condition can be selected if you need nesting).
- If you selected
AND
Condition orOR
Condition in step three, select and choose Condition Node (AND
Condition orOR
Condition can also be selected if you want nested conditions) and choose the Condition Type from the drop-down list. For a description of condition types, see [Variables (../../concepts-and-definitions/sync-engine-and-transformation.md#variables). Based on the condition type selected, different settings are configurable. Your conditions can be a combination of different condition types. See Configure Source Attribute condition, Configure Source Event condition, Configure Attribute Event condition, and Configure Rule Variable condition for details. - Select OK to close the Edit Rule Variable window.
- After all variables are defined, select the RULES section.
Configure Source Attribute condition
The Source Attribute condition type allows you to populate the rule variable when a source attribute contains a specific value based on a comparison operation and criteria.
- In the New Condition window, select Source Attribute Condition from the Condition Type drop-down list.
- Select the source attribute from the Source Attribute drop-down list.
- Select the operator to compare the source attribute value from the Operator drop-down list (e.g. equals, not equals, starts with, etc.).
- Depending on the operator chosen, you may have a Compare with: Constant Value setting where you can enter the value to compare with the source attribute.
- Depending on the operator chosen, you may have a Comparison Type property where you can choose how to handle the case of the attributes in the value (e.g. ignore case, numeric, regex, etc.).
- Select OK.
- Select OK to close the Edit Rule Variable window.
Configure Source Event condition
The Source Event condition type allows you to populate the rule variable when a specific type of event has occurred on the source entry.
- In the New Condition window, select Source Event Condition from the Condition Type drop-down list
- Select either equals or not equals to compare the event from the Assert Equality drop-down list.
- Select the type of event from the Event Type drop-down list (e.g. Inserted Entry, Updated Entry, etc.).
- Select OK.
- Select OK to close the Edit Rule Variable window.
Configure Attribute Event condition
The Attribute Event condition type allows you to populate the rule variable when a specific type of event has occurred on the source attribute.
- In the New Condition window, select Attribute Event Condition from the Condition Type drop-down list
- Select the type of event from the Change Event drop-down list (e.g. Value(s) was added, Value(s) was deleted, etc.).
- Select the attribute that the change event is to be checked for.
- Select OK.
- Select OK to close the Edit Rule Variable window.
Configure Rule Variable condition based on an existing rule variable
The Rule Variable condition type allows you to populate the rule variable when an existing rule variable contains a specific value based on a comparison operation and criteria.
- In the New Condition window, select Rule Variable Condition from the Condition Type drop-down list.
- Select the existing variable from the Rule Variable drop-down list.
- Select the operator to compare the existing variable value from the Operator drop-down list (e.g. equals, not equals, starts with, etc.).
- Enter the value to use for comparison in the Compare With: Constant Value property.
- Choose the Comparison Type (e.g. ignore case).
- Select OK.
- Select OK to close the Edit Rule Variable window.
Edit rule variables
- On the Rule Variables tab, select a variable and select Edit. Change the variable and select OK.
- If you want to delete a local variable, select the variable and select Delete.
- After all variables are defined, select the RULES section.