List of Business Services

Is there a way to get the list of Business Services from a command line call? We are trying to see if there is a way we can automate bring down our Inbound Business Services during a fail over.

 

Thanks

Scott Roth

The Ohio State University Wexner Medical Center

  • 0
  • 0
  • 205
  • 0
  • 3

Answers

SQL way (query docs, 1 means BS):

SELECT *
FROM Ens_Config.Production_EnumerateConfigItems('Your.Production', 1)

Object way:

set rs = ##class(Ens.Config.Production).EnumerateConfigItemsFunc("Your.Production", 1)
do rs.%Display()

Constants for Business Host Type (defined in EnsConstants.inc):

#define eHostTypeUnknown   0
#define eHostTypeService   1
#define eHostTypeProcess   2
#define eHostTypeOperation 3
#define eHostTypeActor     4

Hello Scott,

I was playing around with the EnumerateConfigItems query in the Ens.Config.Production class, and it seems like it might do what you're asking.  Below is some basic example code to demonstrate, but of course you should test this out yourself and add proper status checking and error handling before putting it to use.

If you are interested in other fields returned by this query, you can take a closer look at its class reference documentation.

#include Ensemble

ListBusinessServices() PUBLIC {
                Set productionName = "Demo.Loan.FindRateProduction"
                Set tStatement = ##class(%SQL.Statement).%New()
                Set pStatus = tStatement.%PrepareClassQuery("Ens.Config.Production","EnumerateConfigItems")
                Set tResult = tStatement.%Execute(productionName,$$$eHostTypeService)
                While tResult.%Next() {
                                Write !,tResult.%Get("ConfigName")
                }
}

 

Hi,

Check the following code:

Set tProduction="Demo.HL7.MsgRouter.Production"

// Types:
// Empty: Retrieve all items 
// 1: Business Service
// 2: Business Process
// 3: Business Operation

Set tType="1"

Set tRS = ##class(%ResultSet).%New("Ens.Config.Production:EnumerateConfigItems")

Set tStatus = tRS.%Execute(tProduction, tType)

While tRS.%Next(.tStatus) {

   write tRS.%Get("BusinessType")_" : "_tRS.%Get("ConfigName"),!

}

II hope it's useful

Best regards,

Francisco Lopez