You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

A task could run for many orders. Each order will cause a process represented byspooler_process_before, spooler_process (one ore more times) and spooler_process_after.
The object spooler_task.order available in spooler_process_after points to the order instance currently processed by the task.

 function spooler_process_after(spooler_process_result) {
    spooler_log.info("order id is " + spooler_task.order.id);   // the order object is available
    return spooler_process_result;
 }

It is NOT available in spooler_task_after, because no order is running for the current task anymore.

 function spooler_task_after() {
    if (spooler_task.order == null) {
      spooler_log.info("spooler_task.order is null");           // the order object is NOT available
    }
 }

It does not matter if you run a shell or an API job - this behaviour is the same.

  • No labels