File: Task.rst

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (57 lines) | stat: -rw-r--r-- 1,602 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ecflow.Task
///////////


.. py:class:: Task
   :module: ecflow

   Bases: :py:class:`~ecflow.Submittable`

Creates a :term:`task` :term:`node`. Task is a child of a :py:class:`ecflow.Suite` or :py:class:`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 :term:`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:

.. code-block:: python

  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


.. py:property:: Task.aliases
   :module: ecflow

Returns a list of aliases


.. py:property:: Task.nodes
   :module: ecflow

Returns a list of aliases