Runtime Overrides Config File Settings
Endpoint and Data Element Overrides
Endpoint and Data Element overrides may also be specified via <appSettings/> in the .config file of any application consuming irSDK.
Note: If the Rule Execution Service's .config file contains overrides, any overrides passed in the request will still take precedence over the <appSettings/> overrides.
See the Runtime Overrides ( https://github.com/InRule/Samples/tree/master/Developer%20Samples/RuntimeOverrides) developer samples for additional information.
AppSettings Key | Description |
---|---|
inrule:runtime:overrides:<endpoint-name>:DatabaseConnection:ConnectionString | (string) Database connection string. |
inrule:runtime:overrides:<endpoint-name>:SendMailServer:ServerAddress | (string) Mail server host name. |
inrule:runtime:overrides:<endpoint-name>:WebService:WsdlUri | (string) Web service WSDL URI. |
inrule:runtime:overrides:<endpoint-name>:WebService:ServiceUriOverride | (string) Web service SOAP end point URI. |
inrule:runtime:overrides:<endpoint-name>:WebService:WebServiceMaxReceivedMessageSize | (integer) Web service client max received message size in bytes. (max 2147483647) |
inrule:runtime:overrides:<endpoint-name>:XmlDocumentPath:XmlPath | (string) XML document file path on Runtime Service. |
inrule:runtime:overrides:<endpoint-name>:XmlSchema:XsdPath | (string) XML schema path or URL. |
inrule:runtime:overrides:<endpoint-name>:XmlSchema:EnableXsdValidation | (boolean) Whether to validate XML Entity state against XSD. (true or false) |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServiceRootUrl | (string) REST service root URL. |
inrule:runtime:overrides:<endpoint-name>:RestService:AuthenticationType | (string) REST service authentication type. (None, Basic, NTLM, Kerberos, Custom) |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServiceUserName | (string) REST service authentication username. |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServicePassword | (string) REST service authentication password. |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServiceDomain | (string) REST service authentication domain. |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServiceX509CertificatePath | (string) REST service X509 client certificate path on Runtime Service. |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServiceX509CertificatePassword | (string) REST service X509 client certificate password. |
inrule:runtime:overrides:<endpoint-name>:RestService:RestServiceAllowUntrustedCertificates | (boolean) Whether to allow REST service certificates not signed by trusted CA. (true or false) |
inrule:runtime:overrides:<dataElement-name>:SqlQuery:Query | (string) SQL query text. |
inrule:runtime:overrides:<dataElement-name>:InlineTable:TableSettings | (string) XML serialized string of TableSettings object. (see 1.) |
inrule:runtime:overrides:<dataElement-name>:InlineValueList:ValueListItems | (string) XML serialized string of ValueListItem collection (see 2.) |
inrule:runtime:overrides:<dataElement-name>:InlineXmlDocument:InlineXml | (string) XML document. |
inrule:runtime:overrides:<dataelement-name>:RestOperation:UriTemplate | (string) REST operation URI template |
inrule:runtime:overrides:<dataelement-name>:RestOperation:Body | (string) REST operation body |
inrule:runtime:overrides:<dataelement-name>:RestOperation:Headers:<header-name> | (string) REST operation header |
1. The following C# code can be used with irSDK to create the XML serialized TableSettings from a DataTable:
TableSettings tableSettings = new TableSettings();
tableSettings.InlineDataTable.Columns.Add(new DataColumn("Column1", typeof(string)));
tableSettings.InlineDataTable.Columns.Add(new DataColumn("Column2", typeof(int)));
tableSettings.InlineDataTable.Rows.Add("One", 1);
tableSettings.InlineDataTable.Rows.Add("Two", 2);
StringBuilder sb = new StringBuilder();
using (XmlWriter writer = XmlWriter.Create(sb))
{
XmlSerializer xs = new XmlSerializer(typeof(TableSettings));
xs.Serialize(writer, tableSettings);
}
string serializedTableSettings = sb.ToString();
2. There is no irSDK data structure that can serialize the ValueListItems. The XML should be structured as follows:
< **ValueListItems**>
< **ValueListItem**>
< **DisplayText**> **value one**</ **DisplayText**>
< **Value**> **value1**</ **Value**>
</ **ValueListItem**>
< **ValueListItem**>
< **DisplayText**> **value two**</ **DisplayText**>
< **Value**> **value2**</ **Value**>
</ **ValueListItem**>
</ **ValueListItems**>
Example:
<appSettings>
<add key\="inrule:runtime:overrides:DatabaseConnection1:DatabaseConnection:ConnectionString" value\="Data Source = MyDbHost;Initial Catalog = Customer;Integrated Security = SSPI;" />
<add key\="inrule:runtime:overrides:SendMailServer1:SendMailServer:ServerAddress" value\="smtp.mycorp.com" />
<add key\="inrule:runtime:overrides:XmlSchema1:XmlSchema:EnableXsdValidation" value\="true" />
</appSettings>
Configuration Builders
<appSettings/> may be overridden by mechanisms other than the XML in the .config file.
For example, system Environment variables matching the <appSettings/> keys may be used to take precedence over what is contained in the file.
For this functionality, Configuration Builders must be configured in the .config file.
<configSections>
<section name\="inrule.logging" type\="InRule.Repository.Logging.Configuration.LoggingSectionHandler, InRule.Repository" /> <section name\="inrule.repository" type\="InRule.Repository.Configuration.RepositoryConfigSectionHandler, InRule.Repository" /> <section name\="inrule.runtime" type\="InRule.Runtime.Configuration.RuntimeConfigSectionHandler, InRule.Runtime" /> <section name\="inrule.runtime.service" type\="InRule.Runtime.Service.Configuration.RuntimeServiceConfigSectionHandler, InRule.Runtime.Service" /> <section name\="configBuilders" type\="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
restartOnExternalChanges\="false"
requirePermission\="false" /> </configSections>
<configBuilders>
<builders>
<add name\="Environment"
mode\="Greedy"
name\="inrule:runtime:overrides"
type\="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </builders>
</configBuilders>
<appSettings configBuilders\="Environment">
</appSettings>