Trading Networks 10.7 | Administering and Monitoring B2B Transactions | Trading Networks Built-In Services Reference | Queuing Folder | Summary of Elements in this Folder | wm.tn.queuing:getQueuedTask
 
wm.tn.queuing:getQueuedTask
Dequeues a delivery task from a scheduled delivery queue.
Input Parameters
queue
String The name of the scheduled delivery queue from which you want to dequeue a delivery task.
taskId
String (optional) The task ID of the task to be dequeued from the scheduled delivery queue.
Output Parameters
task
Document The task in the scheduled delivery queue specified by taskId. If you do not specify the task ID, the oldest task in the scheduled delivery task specified by queue. For the structure of task, see wm.tn.rec:Task.
timeDequeued
Object A timestamp indicating when this service dequeued the delivery task returned in task. For Java developers, this is an instance of java.lang.Long.
Usage Notes
*Use this service when you create a scheduled delivery service. Typically, the scheduled delivery service uses this service to dequeue a delivery task and then delivers the document. After delivering the document, your scheduled delivery service should invoke wm.tn.queuing:updateQueuedTask to update the status of the queued delivery task. Note that wm.tn.queuing:getQueuedTask may throw an OutOfMemoryError if a scheduled delivery service has a very large output pipeline. To avoid this error, place the pipeline data from the scheduled delivery service into the serviceOutput parameter of wm.tn.queuing:updateQueuedTask.
For an example of a scheduled delivery service, see the wm.tn.transport:batchFtp service. For a description about how to create a scheduled delivery service, including how to use the wm.tn.queuing:getQueuedTask service, see webMethods Trading Networks Administrator’s Guide.
*The wm.tn.queuing:updateQueuedTask service uses the timeDequeued value. Do not modify this value or drop it from the pipeline before invoking wm.tn.queuing:updateQueuedTask.
*If you do not specify a taskId, Trading Networks dequeues the oldest updated task in the queue (first in, first out).