Create a task and call to a Business Process [SOLVED]
Hi all,
I wonder if is possible to create a task object and this task calls to a Business Process (or business operation)
My attempt was:
/// Task Special purge Class MyTasks.SpecialPurge Extends %SYS.Task.Definition { Parameter PROPERTYVALIDATION = 1; Parameter BPSPECIALPURGE= "Special Purge"; Parameter TaskName = "Special purge in SQL"; Property MinutesDelay As %Integer [ InitialExpression = 15, Required ]; Method OnTask() As %Status { // Create the date to purge set datePurge= $SYSTEM.SQL.DATEADD("minute",-1*..MinutesDelay, $HOROLOG) $$$ThrowOnError(##class(Ens.Director).CreateBusinessService(..#BPSPECIALPURGE, .tService)) If ($IsObject(tService)) { Set tSC = tService.ProcessInput(datePurge,.output) } } }
But it doesn't work.
Other attempt was extend the class to
set tSC = ..SendRequestSync(..#BPSPECIALPURGE, datePurge, .pOutput)
But this idea also doesn't work
Any idea how to do?
Best regards