Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$ASKSTOP^%ZTLOAD(): Stop TaskMan Task

Reference Type: Supported, Category: TaskMan, ICR#: 10063

Description

The $$ASKSTOP^%ZTLOAD extrinsic function asks TaskMan to stop running a specified task. Also, it checks for the ZTNAME variable, and if defined, it uses it instead of DUZ to value the STOP FLAG (#59.1) field. ZTNAME is supported by applications calling this API to indicate the process that asked the task to stop.

Format

  $$ASKSTOP^%ZTLOAD(ztsk)

Input Parameters

ztsk:

(required) Task number of the TaskMan task to be stopped.

Output

returns:

Returns:

  • 0—"Busy". If it returns "Busy", it could mean that:

    • Task is locked.

    • Someone else is changing it.

    • TaskMan is starting to run it.

  • 1—"Task missing" or Task "Finished running". If it returns:

    • "Task missing", it could mean that it was an incorrect input task number, but it is most likely that the task ran and was removed after running.

    • "Finished running", it means that the task was finished running before the API request could go through, so the API could not stop an already finished task.

  • 2—"Asked to stop" or "Unscheduled". If it returns:

    • "Asked to Stop", the task has started running and the stop flag has been set, so if the application checks ($$S^%ZTLOAD) it should stop.

    • If it returns "Unscheduled", it was successful and the task is not scheduled any more.