Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Simple way of calling EnableConfigItem from within an Operations/Service

Question
Scott Roth · Dec 16, 2022

Simple way of calling EnableConfigItem from within an Operations/Service

Was wondering if anyone had a simple way of calling  ##class(Ens.Director).EnableConfigItem() within a Business Process or adding code to a Custom Service to start or stop the object?

The use case is that I have a Process that uploads a file into a external SQL table. When it is finished I want it to kick off another Service that does the processing of the data that it just uploaded. Once it is finished the response is sent back to the service and when the service receives the response from the process, I want to stop that service from running.

so...

  1. Service  A sends file to Process A to upload into SQL.
  2. Once Process A is complete, send command to start another Service B.
  3. Service B sends command to Process B, and when Process B completes it sends the response to Service B which will tell Service B to stop.

I could just add code within the Process and Service to call ##class(Ens.Director).EnableConfigItem() but is that the best practice?

#Business Process (BPL) #Business Service #ObjectScript #Caché
Product version: Caché 2018.1

Source URL:https://community.intersystems.com/post/simple-way-calling-enableconfigitem-within-operationsservice