How to program a schedule for an adapterless service

Hi world,

i want to program a schedule for my adapterless business service , i found a method "test" in "Ens.ScheduleHandler" but i don't know how i program it for my service can be invoked each one houre by day .

i'm waiting for your help because it's the key for my application .

i don't like to use ensemble portal.

Thank's.

  • 0
  • 0
  • 345
  • 1
  • 3

Answers

there is an easy solution to your issue. Simply use a Cache Task Manager. Create a new task, and within code, instantiate Ensemble service Ens.Director,

e.g.

Set tSC=##class(Ens.Director).CreateBusinessService("your service configration name",.tService)

If ($$$ISERR(tSC)) Quit
Set tSC=tService.ProcessInput(%request,.output)
If ($$$ISERR(tSC)) Quit
If $IsObject($G(output)) {

   // do whatever you want here

}

thank's Daniel for the answer , my problem is how to trig my service each houre , is there any loop ? i'm beginner in caché .

thank's

Soufiane,

Following on from Daniel's instructions... Once you have created a class with the suggested your code to invoke your service, add this as a task in Task Manager.  You can ask Task Manager to invoke this every hour.

Sincerely,

Steve 

To run Business Service once an hour:

  1. Specify Ens.InboundAdapter as an adapter for your Business Service
  2. On Production Configuration page, in Business Service configuration set Call Interval to 3600.
  3. Restart Business Service. It would now be run once an hour (every 36000 seconds)