I have created the following Task to kick off a Ens.BusinessService to execute a SQL query and process the results
Class OSU.Workday.TerminationsTask Extends %SYS.Task.Definition
{
Parameter TaskName As STRING = "OSU - Workday Termination Update";
Method OnTask() As %Status
{
#Dim sc as %Status
#Dim ex as %Exception.AbstractException
set sc = $$$OK
try{
// create the service
#Dim tService As OSU.DataSource.Workday.TermService
Set tServiceConfigName = "OSU.DataSource.Workday.TermService"
// Call BusinessService
$$$ThrowOnError(##class(Ens.Director).CreateBusinessService(tServiceConfigName,.tService))
$$$ThrowOnError(tService.Adapter.OnTask())
set (tHint) = ""
}catch ex{
set tSC = ex.AsStatus()
}
quit tSC
}
ClassMethod TestTask()
{
set tTask = ##class(OSU.Workday.TerminationsTask).%New()
$$$ThrowOnError(tTask.OnTask())
}
/// Location and Revision of this file in Perforce (Auto-updating)
Parameter SrcVer = "$Id$";
}

.png)

.png)



