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 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
ecflow.Trigger
//////////////
.. py:class:: Trigger
:module: ecflow
Bases: :py:class:`~Boost.Python.instance`
Add a :term:`trigger` or :term:`complete expression`.
This defines a dependency for a :term:`node`.
There can only be one :term:`trigger` or :term:`complete expression` dependency per node.
A :term:`node` with a trigger can only be activated when the trigger has expired.
Triggers can reference nodes, events, meters, variables, repeats, limits and late flag
A trigger holds a node as long as the expression returns false.
Exception:
- Will throw RuntimeError if first expression is added as 'AND' or 'OR' expression
Like wise second and subsequent expression must have 'AND' or 'OR' booleans set
Usage:
Multiple trigger will automatically be *anded* together, If *or* is required please
use bool 'False' as the last argument i.e. :
.. code-block:: python
task1.add( Trigger('t2 == active' ),
Trigger('t1 == complete or t4 == complete' ),
Trigger('t5 == active',False))
The trigger for task1 is equivalent to :
.. code-block:: python
t2 == active and t1 == complete or t4 == complete or t5 == active
Since a large number of triggers are of the form `<node> == complete` there are
are short cuts, these involves a use of a list :
.. code-block:: python
task1.add( Trigger( ['t2','t3'] )) # This is same as t2 == complete and t3 == complete
You can also use a node :
.. code-block:: python
task1.add( Trigger( ['t2',taskx] ))
If the node 'taskx' has a parent, we use the full hierarchy, hence we will get a trigger
of the form :
.. code-block:: python
t2 ==complete and /suite/family/taskx == complete
If however node taskx has not yet been added to its parent, we use a relative name in the trigger :
.. code-block:: python
t2 ==complete and taskx == complete
.. py:method:: Trigger.get_expression( (Trigger)arg1) -> str :
:module: ecflow
returns the trigger expression as a string
|