Tasks

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

From the Developer ribbon, select the Tasks tool to display the Task Manager.
Figure 1.


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


Within the user interface, you can reposition the Tasks Browser:
  • Left-click and drag the dotted rows to reposition the browser into open space so it appears as a free-standing dialog.
  • Snap it to a docked location on the side or bottom of the browser area.

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 by the tasks (even before or after them), 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 3.


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 4.


Tip: Click the arrow, , to expand and collapse the sections.

User Interface

The Tasks Browser user interface 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

Active

To change the columns/attributes that display in the browser, right-click on a column heading and toggle the check boxes in the micro dialog.
Figure 5.


The Run and Active options are off by default.

Click the arrow in the Run column to run a specific task.

Active indicates that the task is active within the process.

Expand Categories From the Tasks-Config dialog, click the arrow, , to expand and collapse the categories.
Previous and Next

Use the arrows in the lower right corner of the browser to go to the previous or next task.

Run a Task

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


    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.
    The Tasks-Config dialog is displayed, which contains the properties that are part of the Config task.
    Note: Click the arrow, , to expand and collapse the categories.
    Figure 7.


  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.