Let’s talk about the ReFramework first. The ReFramework uses - indeed as you mentioned - a dictionary to store the configuration values. This happens in the initialization state
Looking closer at the initialization state - there is an if condition to determine whether the Config has been initialized already. If not, it will proceed running the InitAllSettings.xaml workflow. Since there has been no default value set for the Config variable, this will evaluate to True the first time the process is ran.
InitAllSettings.xaml will initialize the Config variable using the new keyword:
When doing so, the expression
Config is Nothing evaluates to False. Even if the Dictionary is empty, it does not evaluate to
Nothing since its now a Dictionary object. You -might- wonder: Why do we check if Config is set before reading the configuration file? We’re checking if Config is set before its set!. This is because in the ReFramework - and it is also best practice to do so - when an Application Exception (aka System Exception) occurs the initialization state is triggered again. This will close all applications to then re-initialize all applications (open, login, etc.) but the If condition prevents re-reading the configuration file.
In InitAllSettings.xaml the configuration file is read across several excel sheets within it. It loads all of these values into a Dictionary where the keys are of type
String and the values are of type
Object. This is because the Excel cells can be of different types - for instance
Int, and so forth. It will also fetch all Orchestrator assets that you specify in the Assets worksheet of the configuration file.
Ok so lets say you would like to create your own configuration file. It is really as simple as:
- Read Range to get a DataTable filled with your configuration data
- For each the DataTable
- Use the Assign activity to put it into the Dictionary.
- You can now use your dictionary to get the configuration file. For example