Triggers defines define a dependency for on a task or family . There can be only one trigger dependency per node, but that can be a complex boolean expression of the status of several nodes. Triggers can not be added to the suite node. A node with a trigger can only be activated when its trigger has expired. A trigger holds the node as long as the trigger’s expression evaluation returns false.
Trigger evaluation occurs when ever whenever the child command communicates with the server. i.e. whenever there is a state change in the suite definition and at least once every 60 seconds. The keywords in trigger expressions are: unknown , suspended , complete , queued , submitted , active , aborted and clear and set for event status. Triggers can also reference Node attributes like event , meter , variable , repeat and generated variables and limits. Triggers can also reference the late flag on a node. Trigger evaluation for node attributes uses integer arithmetic. See Glossary
...
There are many times where we want to add a chain of tasktasks, i,.e. where task tasks must be run sequentially one after the other. The following examples show different styles of chaining tasks which are identical:
Code Block |
---|
| from ecflow import *
defs = Defs(
Suite("s1",
Task("t1"),
Task("t2",Trigger( "t1 == complete" )),
Task("t3",Trigger( "t2 == complete" )),
Task("t4",Trigger( "t3 == complete" )))) |
|
Code Block |
---|
| from ecflow import *
defs = Defs() + Suite("s1")
defs.s1 += [ Task("t1"),Task("t2"),
Task("t3"),Task("t4") ]
defs.s1.t2 += Trigger( ["t1"] )
defs.s1.t3 += Trigger( ["t2"] )
defs.s1.t4 += Trigger( ["t3"] ) |
|
Code Block |
---|
| from ecflow import *
defs = Defs() + Suite("s1")
defs.s1 >> Task("t1") >> Task("t2") >> Task("t3") >> Task("t4")
# >> relies on the leading node to be a Family or Suite |
|
...
Code Block |
---|
| defs = Defs() + Suite("s1")
defs.s1 += [ Task("t1"),Task("t2"),Task("t3"),Task("t4") ]
defs.s1.t1 += Trigger( "t2 == complete" )
defs.s1.t2 += Trigger( "t3 == complete" )
defs.s1.t3 += Trigger( "t4 == complete" ) |
|
Code Block |
---|
| defs = Defs() + Suite("s1")
defs.s1 << Task("t1") << Task("t2") << Task("t3") << Task("t4")
# << relies on the leading node to be a Suite or Family |
|
Warning |
---|
In the examples above we use 'defs.s1.*' to reference a node by name. This is useful in small designs but will produce maintenance issues in large designs IF the node names are changed. |