![]() ![]() |
Reference Type: Supported, Category: TaskMan, ICR#: 1519
The $$REQQ^XUTMDEVQ extrinsic function schedules the second task (i.e., print data) from the $$QQ^XUTMDEVQ API.
If it takes a long time to gather and print data, users should split the job into two tasks:
Separating the data-gathering task from the data print task helps avoid unnecessarily tying up a printer while large amounts of data are gathered.
This API makes sure that only the scheduled time and any variables in %VAR are passed to the REQ^%ZTLOAD API.
NOTE: This API was released with Kernel Patch XU*8.0*389.
$$REQQ^XUTMDEVQ(xutsk,xudth[,[.]%var])
xutsk: |
(required) This input parameter is the TaskMan task to schedule the second task from $$QQ^XUTMDEVQ API and should be in the XUTMQQ variable. |
xudth: |
(required) This input parameter is the new scheduled run time. |
[.]%var: |
(optional) This input parameter is converted to the ZTSAVE variable; it is the same as the %var input parameter for the $$DEV^XUTMDEVQ API. |
returns: |
Returns:
|
This example is a job that consists of gathering information and then
printing it. Assume that the gathering takes a few hours. You do not want
the device that the user selects to be tied up for that time, so you divide
the job into two tasks. The first task gathers the information, and the
second task prints it. Use
$$QQ^XUTMDEVQ to select the device, schedule the gather task,
and queue the print task. Use the $$REQQ^XUTMDEVQ API to schedule the
print task when the gather task finishes.
NOTE: This is the easiest way to divide a job into two tasks.
ARHBQQ ;SFVAMC/GB - Demo of 'gather' and 'print' in 2 tasks ;1/19/06 08:31 ;;1.1 QQ ; N X S X=$$QQ^XUTMDEVQ("GATHERQ^ARHBQQ","ARHB Gather",,,,,1,"PRINTQ^ARHBQQ","ARHB Print") W !,"X=",X Q GATHERQ ; N ARHJ,X S ZTREQ="@" S ARHJ="ARHB-QQ"_"-"_$J_"-"_$H ; namespace + unique ID K ^XTMP(ARHJ) ; Use ^XTMP to pass a lot of data between tasks. S ^XTMP(ARHJ,0)=$$FMADD^XLFDT(DT,1)_U_DT ; Save-thru and create dates. S ^XTMP(ARHJ)="HI MOM!" ; Pretend this is a lot of data! ; XUTMQQ holds the ZTSK of the print task S X=$$REQQ^XUTMDEVQ(XUTMQQ,$H,"ARHJ") ; Schedule print task to start Q PRINTQ ; S ZTREQ="@" ;U IO ; Don't need this if invoked using a ^XUTMDEVQ API. W !,"The secret message is: '",$G(^XTMP(ARHJ)),"'" K ^XTMP(ARHJ) Q |