Read Configuration Parameters

All of the fetch action methods you can override in ConnectorBase are passed a task object that has a taskConfig() that returns the configuration for the task.

NOTE: The task configuration returned by the methods of the TaskConfig object can be different to what is specified in the configuration file. This is because the settings in the configuration file can be overridden by settings passed to ACI actions.

The following lines demonstrate how to read string, integer and boolean values:

       std::string param = task.taskConfig().get("Param", "DefaultValue");
       int numeric = task.taskConfig().getInt("Numeric", 6);
       bool boolean = task.taskConfig().getBool("Boolean", true);

Each of the methods called above takes the name of the parameter to read and the default value to return if the parameter is not specified. Values for these parameters might be specified in a configuration file like this:

       Param=MyValue
       Numeric=4
       Boolean=False

You can read encrypted values (such as passwords that were encrypted with autpassword.exe) using the getEncrypted function:

       std::string password = task.taskConfig().getEncrypted("Password");