Here's a method that might get you close to what you want:
ClassMethod GetHostsByAdapter(pProduction As %String, pAdapterName As %String) As %List
{
Set tPrd = ##class(Ens.Config.Production).%OpenId(pProduction)
Return:'$ISOBJECT(tPrd) "Production does not exist!"
Set tItems = tPrd.Items
Set tItemCnt = tItems.Count()
Set tHostList = ""
Set tCnt = 1
For i=1:1:tItemCnt
{
Set tItem = tItems.GetAt(i)
If $CLASSMETHOD(tItem.ClassName,"%GetParameter","ADAPTER") = pAdapterName
{
Set $LIST(tHostList,tCnt) = tItem.Name
Set tCnt = tCnt + 1
}
}
Return tHostList
}Call it with:
Set hosts=##class(<classname>).GetHostsByAdapter("<production name>","EnsLib.HTTP.InboundAdapter")
The variable hosts will contain the list (in $LIST form) of business hosts that have the adapter specified as the 2nd argument.
- Log in to post comments
.png)