PROG="SomeCatalogEntry"
task="%SYS.Task"->OpenId(PROG)
if task='' then
task="%SYS.Task"->%New()
task->Name=PROG
task->NameSpace=SYSTEM(1052)
task->OpenOutputFile=1
task->OutputFileIsBinary=1
task->OutputFilename=PATH
task->RunAsUser=@Authorization
task->Settings=$lb("ExecuteCode",'MV ':DQUOTE(PROG))
task->TaskClass="%SYS.Task.RunLegacyTask"
task->TimePeriod=5
task->TimePeriodEvery=1
task->Type=2
st=task->%Save()
if st#1 then abortm "failed to save task ":$SYSTEM.STATUS->GetErrorText(st)
end
id=task->%Id()
if id='' then abortm "task has no id ":$SYSTEM.STATUS->GetErrorText(st)
$kill task
st="%SYS.Task"->Resume(id)
if st#1 then abortm "resume failed ":$SYSTEM.STATUS->GetErrorText(st)
st="%SYS.Task"->RunNow(id)
if st#1 then abortm "runNow failed ":$SYSTEM.STATUS->GetErrorText(st)
SomeCatalogEntry is a basic program that has been cataloged. It gets run by the task using the MV command, though you could probably use DO ^rtnName as well.
> --
> You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
> To post to this group, send email to Cac...@googlegroups.com
> To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/CacheMV?hl=en
--
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To post to this group, send email to Cac...@googlegroups.com
To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CacheMV?hl=en
From: Bill Farrell