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...
- Service A sends file to Process A to upload into SQL.
- Once Process A is complete, send command to start another Service B.
- 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?
How do I get OnResponse() to take the response of Process B? I tried specifying a value for the response but I am seeing a NULL sent back to Service B.
We had the case that the ACK of an operation always changed in case of an error and the following messages always threw an error although everything was ok. A restart has then always helped until the next error.
Solution was to catch the ACK in the router and check it. If the error was found a TRACE was executed in which ##class(Ens.Director).EnableConfigItem() was called.
Return Value is the status ;)
Why do you want to stop the service from running?
Some of our Objects are run as jobs to insert/update, or process data in an external database. Since MS SQL Integration Server (ssis) is limited in logging and notifications, I thought it was best to move it over to IRIS/Ensemble so the rest of my team could Support.
Great! Why not keep the service running but idle all the time?
It only needs to run if we inserted data into the tables once a week so how would we do that besides EnableConfigItem script? I was looking to trigger the event based on if the service A and process A had been completed.
Sorry, a post at fever pitch. My approach here was not purposeful. At what point do you define the reply message?
Within the Business Process B.