ecflow.Task

class ecflow.Task

Bases: Submittable

Creates a task node. Task is a child of a ecflow.Suite or ecflow.Family node.

Multiple Tasks can be added, however the task names must be unique for a given parent. Note case is significant. Only Tasks can be submitted. A job inside a Task ecf script (i.e .ecf file) should generally be re-entrant since a Task may be automatically submitted more than once if it aborts. There are several ways of adding a task, see examples below

Constructor:

Task(name, Attributes)
   string name : The Task name.Name must consist of alpha numeric characters or
                 underscore or dot. First character cannot be a dot.
                 Case is significant
   attributes: optional, i.e like Meter, Event, Trigger etc

Exception:

  • Throws a RuntimeError if the name is not valid

  • Throws a RuntimeError if a duplicate Task is added

Usage:

task = Task('t1')            # create a stand alone task
family.add_task(task)        # add to the family
t2 = family.add_task('t2')   # create a task t2 and add to the family

# Create Task in place
defs = Defs(
         Suite('s1',
            Family('f1',
               Task('t1',
                  Trigger('1==1'),
                  Edit(SLEEP='10'))))) # add Trigger and Variables in place
property Task.aliases

Returns a list of aliases

property Task.nodes

Returns a list of aliases