Default settings - Application priorities
Hello everyone.
I have a question regarding the priority when applying a default configuration.
I have several Business Services that use the same class, so I want them all to have a common "Schedule" configuration.
However, there's one that I don't want this default configuration applied to, so I've tried setting the Schedule value to empty for that element based on its name:
In this case, the elements that use the class Kurro.BS.SFTP.Marca have the default value "CargaFicheros".
.png)
However, one of the elements (Kurro.BS.SFTP.Special) should not have this configuration, so I have created an entry for this element.
.png)
The problem is that in production, the Kurro.BS.SFTP.Especial element appears with the host class's default configuration, instead of the one I specified for the element.
I also can't remove it directly from production because it tells me it's a Core setting and I can't modify it because it has a Default Setting property.
.png)
How can I set a specific configuration for an element that doesn't use the host class configuration?
Thank you so much
Comments
Check out %GetSetting implementation in Ens.Config.DefaultSettings:
// Look in table starting with most specific matchIf$D(^Ens.Config.DefaultSettingsD(pProductionName,pItemName,pHostClassName,pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD("*", pItemName,pHostClassName,pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD(pProductionName,"*", pHostClassName,pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD("*", "*", pHostClassName,pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD(pProductionName,pItemName,"*", pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD("*", pItemName,"*", pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD(pProductionName,"*", "*", pSettingName),data)
|| $D(^Ens.Config.DefaultSettingsD("*", "*", "*", pSettingName),data)
In your case your first setting would be resolved on line three:
$D(^Ens.Config.DefaultSettingsD(pProductionName,"*", pHostClassName,pSettingName),data)And your second setting would be resolved on line five:
|| $D(^Ens.Config.DefaultSettingsD(pProductionName,pItemName,"*", pSettingName),data)
But since line three resolves to a valid setting, line five would never be hit.
To work around that provide both item name and class name explicitly - it would be resolved on the first line for your outlier (since both item and class match) and the rest of the items would get their setting resolved on line three.
Thanks Eduard.
Indeed, adding the class name and the element name makes it work.
.png)