Eduard Lebedyuk · May 29, 2019

Send request to BP on production start

How do I send request on production start?

Here's what I got so far in my production class:

ClassMethod OnStart(pTimeStarted As %String) As %Status
    job ..InitialTraining()
    quit 1

lassMethod InitialTraining() As %Status
    hang 5
    set sc = ##class(EnsLib.Testing.Service).SendTestRequest(...)
    quit sc

Is there a better way without hang, etc?

0 259
Discussion (1)0
Log in or sign up to continue

Added a dummy BS to production with OnInit:

Class test.InitService Extends Ens.BusinessService

Parameter ADAPTER = "Ens.InboundAdapter";

Property Adapter As Ens.InboundAdapter;

Method OnProcessInput(pInput As %RegisteredObject, Output pOutput As %RegisteredObject) As %Status [ CodeMode = expression ]

/// This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
Method OnInit() As %Status
    set sc = ..SendRequestAsync(...)
    quit sc