Lookup Schema
Lookup Schemas are used to create an adaptable Schema that uses a Key and Value pair and can be used to give aliases to static values used in a Rule or Action. There are two main uses for this:
-
Giving Values more meaningful names in the Rules and Actions Builder.
This could be as simple as taking a machine created value and renaming it to something human-readable.
-
Update the Schema to make changes to Rules and Actions.
Changes can be made to the Schema by changing which Values are linked to Keys. This allows the same Rules and Actions to be run with different Schemas that use the same Key but utilise different Values.
Example: The Value "01t9Rx8" could be given the alias "Water Mains" making it much easier to tell what is being used in Rule and Action building.
Example: A Rule that looks at a district that a contractor works on changes hands from one contractor to another. Using a Lookup Schema means that the Value can be changed without needing to create a new Rule.
Configuring the Schema
When a new or existing Data Store requires a Lookup Schema it can be added in the Data Store settings.
-
When configuring a Data Store choose the Lookup Schema option from the Fixed Schema Type drop down menu.
-
In class and attribute mappings for either Read and Commit and/or Copy To, expand the class you want to work on.
-
Select the Target field of the String that you want to use as the Key.
Note: The Key must always be a String.
-
Select the Target field for the attribute you want to pair it with and select Value.
-
Repeat Steps 3 and 4 for any other Classes that are necessary.
Using Lookup in Rules and Actions
After configuring the Schema, Lookup Values can be used in a Rule or Action.
-
Open a Rule or Action and select a Value node.
-
Choose Named Lookup Value from the Dynamic section.
-
Click on the Lookup Data Store parameter, and pick the Data Store that you wish to use.
-
From the Selected Value pick the Key that you wish to use.
Note: These Keys will be named as they are listed in the file used in the Data Store.