...
Code Block |
---|
|
from ecflow import Defs,Suite,Task,AutoCancel, TimeSlot
defs = Defs()
s1 = defs.add_suite("s1")
s1.add_task("t1").add_autocancel(3) # delete task after 3 days after completion
s1.add_task("t2").add_autocancel(1, 10, True) # delete task 1hr 10 min after task completion
s1.add_task("t3").add_autocancel(TimeSlot(2,10), True) # delete task 2hr 10 min after task completion
s1.add_task("t4").add_autocancel(Autocancel(1)) # delete task after 1 day after task completion
s1.add_task("t5").add_autocancel(Autocancel( 18, 10, False)) # delete task at 6:10pm once it has completed
s1.add_task("t6").add_autocancel(Autocancel(TimeSlot(2,10), False))# delete task at 2:10am once it has completed |
The following examples show alternative styles of adding Autocancel which produce the same definition.
Code Block |
---|
| defs = Defs().add(
Suite("s1").add(
Task("t1").add(Autocancel(3)),
Task("t2").add(Autocancel(1, 10, True)),
Task("t3").add(Autocancel(TimeSlot(2,10), True)),
Task("t4").add(Autocancel(1)),
Task("t5").add(Autocancel(18, 10, False)),
Task("t6").add(Autocancel(2, 10, False)))) |
|
Code Block |
---|
| defs = Defs().add( Suite("s1"))
defs.s1 += [ Task("t{}".format(i)) for i in range(1,7)]
defs.s1.t1 += [ Autocancel(3) ]
defs.s1.t2 += [ Autocancel(1, 10, True) ]
defs.s1.t3 += [ Autocancel(TimeSlot(2,10), True) ]
defs.s1.t4 += [ Autocancel(1) ]
defs.s1.t5 += [ Autocancel(18, 10, False) ]
defs.s1.t6 += [ Autocancel(2, 10, False) ] |
|