Question:
How can I get a value of a setting of a Production item programmatically?
Answer:
You can use one of the API methods of the Ens.Director class, for example:
Ens.Director:GetItemSettingValue()
For example –
In the Production Demo.Workflow.Production the item (Business Operation) 'Demo-Development' has an 'Auto Create Role' setting:
Clicking on the Settings Defaults button you can see this is a 'Host' setting:
And you can access the value using this call for example:
ENSDEMO>write ##class(Ens.Director).GetItemSettingValue("Demo-Development","Host","AutoCreateRole",.status)
1
Note the first argument simply includes the configuration item name 'Demo-Development', as this is the "current" Production.
You can send in a pair of <Production Name>||<Item Name> and get the value of any item in any Production defined.
For example from the Demo.Loan.FindRateProduction Production's Demo.Loan.FindRateOperation, we can access the 'File Path' or 'Business Partner' values –
Note this time the 'File Path' setting is an "Adapter" one and not a "Host" one.
You can get their values using:
ENSDEMO>write ##class(Ens.Director).GetItemSettingValue("Demo.Loan.FindRateProduction||Demo.Loan.FindRateFileService","Adapter","FilePath",.status)
C:\Practice\loan\in
ENSDEMO>write ##class(Ens.Director).GetItemSettingValue("Demo.Loan.FindRateProduction||Demo.Loan.FindRateFileService","Host","BusinessPartner",.status)
LoanTech Corporation