webCOMAND

System Task Model

  • Namespace: io_comand_systemtask\models
  • Extends: cObject
  • Implements: logging

Represents a System Task, which is a background process started by a Scheduled Task or the CLI.

System Tasks that are currently running, or previously ran can be accessed from the webCOMAND UI Notifications and Alerts sidebar, where their progress and logged events can be viewed.

Properties

Setup

  • Title - Title of the task, which will be used to identify the task in the list of system tasks.
  • User - The user who initiated this task. This is not necessarily the same as the user who the task will run as.
  • Email - If set, the system will email the task status and event log to the user who initiated this task, as well as to the additional recipients specified in EmailTo.
  • Email To - An optional comma-separated list of additional users to email status and events to in this task. This email will also always go to the user who initiated this task. For example:
  • Retries - The number of times this task should be repeated in the event that a failure occurs (that is, when an "Unexpectedly Terminated" process status is encountered). 0 indicates that the task will not be retried (the default), 1 indicates that it will be retried once, etc.
  • Timeout - If set, and if an 'On Timeout' action is selected, this is the number of seconds after which the 'On Timeout' action will be taken. 0 implies that the process will never timeout.
  • On Timeout - If set, and if a non-0 'Timeout' is defined, this action will be taken when the process execution exceeds 'Timeout' seconds. Processes that are canceled or killed for exceeding their max runtime will not be automatically retried.
  • Runnables - The runnable content that was invoked for this task.
  • Parameters - The JSON array of parameters to use in this task. This array's length should be exactly equal to the number of selected Runnables, and holding at each index an associative or non-associative array of parameters to pass in to each Runnable respectively. For example, for two runnables:
  • Retention - The amount of time, in hours, that this SystemTask should be left in the system before it is automatically purged. If 0, it is never automatically removed.

Process

  • Process ID - Process ID for the operating system process used to execute the task.
  • Process State - State of the process as last determined by the system. The system will periodically check on a process to see if it has terminated without reporting completion.
  • Process State Change - The timestamp at which the process state last changed. This is used to detect when to kill a process that has been 'canceling' for too long.
  • Is Running - This checkbox is checked if the process is still running.
  • Create Time - Time the task was created.
  • Start Time - Time the task was started.  It may be awhile after the Create Time if the task is queued while waiting for other blocking tasks to complete.
  • End Time - Time the task completed.
  • Exceeded Timeout - This checkbox is checked if the process has exceeded its configured timeout. This is used internally to determine when to perform 'OnTimeout' actions that don't kill the process.
  • Retried Task - A reference to the System Task that this task is a 'retry' of, if applicable.
  • Scheduled Task - This field will be populated if this was initiated from a scheduled task.

Status

  • Status - Brief description of the current status of the task.  Updated by log_status().
  • Task Results - Meta data describing the actionable results for this task, such as URLs to published pages.  Added by log_result().

Event Log

  • Event Count - Total events in the event log.
  • Success Count - Number of success events in the event log.
  • Error Count - Number of error events in the event log.
  • Warning Count - Number of warning events in the event log.
  • Notice Count - Number of notice events in the event log.
  • Event Log - The System Task's event log, converted to HTML.
  • Task Event Demotions - Lists all demotable events and their actions.