...
Code Block |
---|
time 23:00 # trigger :TIME == 2300
date 1.*.* # trigger :DD == 1
day monday # trigger :DOW == 1 |
Triggers can also use AND/OR logic and the full range of operators <,>,<=,>=
Code Block |
---|
language | bash |
---|
title | Time attributes |
---|
| task t1
day monday
time 13:00 |
|
Code Block |
---|
language | bash |
---|
title | time based trigger |
---|
| task t1
trigger :DOW == 1 and :TIME >= 1300 |
|
Code Block |
---|
language | bash |
---|
title | combination |
---|
| task t1
day monday
trigger :TIME >= 1300 |
|
---|
Warning |
---|
It should be noted that relative time( time + 00 : 01) are not possible with time based triggers, and time series are more problematic. |
...
Code Block |
---|
# Definition of the suite test
suite test
edit ECF_INCLUDE "$HOME/course" # replace '$HOME' with the path to your home directory
edit ECF_HOME "$HOME/course"
family f2
edit SLEEP 20
task t1
task t2
trigger :DOW == 4 and :TIME >= 1300
task t3
trigger :DD == 1 and :TIME >= 1200
task t4
task t5
trigger :TIME == 0002 # 2 minutes past midnight
endfamily
endsuite |
...
Code Block |
---|
language | py |
---|
title | $HOME/course/test.py |
---|
|
import os
from ecflow import Defs,Suite,Family,Task,Edit,Trigger,Complete,Event,Meter,Time,Day,Date,Edit
def create_family_f2():
return Family("f2",
Edit(SLEEP=20),
Task("t1"),
Task("t2", Trigger(":DOW == 4 and :TIME >= 1300")),
Task("t3", Trigger(":DD == 1 and :TIME >= 1200")),
Task("t4"),
Task("t5", Trigger(":TIME == 0002"))) # 2 minutes past midnight
print("Creating suite definition")
home = os.path.join(os.getenv("HOME"), "course")
defs = Defs(
Suite("test",
Edit(ECF_INCLUDE=home,ECF_HOME=home),
create_family_f2()
))
print(defs)
print("Checking job creation: .ecf -> .job0")
print(defs.check_job_creation())
print("Checking trigger expressions")
errors = defs.check()
assert len(errors) == 0,errors
print("Saving definition to file 'test.def'")
defs.save_as_defs("test.def") |
...