Tasks

The Task Manager allows you to organize Python scripts into individual tasks and package them into a single process that you can easily follow. The tasks, their GUI, and the process structure are all defined via an XML file.

Upon loading the XML file, the Tasks Browser constructs the process tree and the dialogs for the individual tasks.

Another component of the process is the Python files that contain all callback functions that are called by the different tasks defined in the XML file. These functions can be commands that execute a specific task, commands that are applied before or after the tasks, and so on. The information defined in the XML file can be changed during run time by the Task Manager Python APIs (hw.taskmanager module). All commands can also be executed by Python APIs.

See the Task Manager topic in the API, References Guides for more information.

Task Structure

Process Item

The basic item in the XML file is the process item. The process item contains the task items, which can be divided into one or more category items. A task can also have property items (GUI widgets) which are different parts of the task. The properties can also be divided into one or more categories.
  • Process
  • Task 1
  • Process
    Category1
    • Task 2
      • Property 1
      • Property_Category 1
        • Property 2
        • Property 3
    • Task 3
In the following example, the process Pre Process SETGET contains six tasks, five of them contained in one category named Task.
Figure 1.


After applying the current task, the Task Manager immediately goes to the next task. In this example, the task Config contains five categories (bold font) for different sets of properties (plain font).
Figure 2.


Toolbar

The Tasks Browser toolbar contains the following tools:
ToolDescription
Load session Loads the XML file.
Save session Saves the current state of the process to an XML session file.
Run selected task Runs a specific task.
Run all tasks from selected task Runs (applies) all tasks automatically, starting from a selected task. All property values must be correctly populated in each task, otherwise the task may fail, stopping the process.
Launch help Launches an additional help file that elaborates on the sample XML file.
Reload Reloads the original session.

Run a Task

  1. From the Developer ribbon, select the Tasks tool.
    Figure 3.


    If the Developer ribbon is not visible, select View > Ribbons > Developer.
  2. From the Tasks Browser, click to load an XML file that contains tasks and their attributes.
  3. Click the first task.
    A dialog is displayed, which contains the properties that are part of the Config task.
    Figure 4.


  4. Click Apply, , to execute the task.
    The task succeeds or fails.
  5. Click to run the selected task.
  6. Click to run (apply) all tasks automatically, starting from a selected task.
    Note: All property values must be correctly populated in each task, otherwise the task may fail, stopping the process.