defs = Defs()
s1 = defs.add_suite("s1")
t1 = s1.add_task("t1")
t2 = s1.add_task("t2")
t2.add_trigger( "t1 == active and t3 == aborted" )
t2.add_complete( "t3 == complete" )
t3 = s1.add_task("t3")
Code Block
language
py
defs = Defs().add(
Suite("s1").add(
Task("t1"),
Task("t2").add(
Trigger("t1 == active and t3 == aborted"),
Complete("t3 == complete")),
Task("t3")))
Code Block
language
py
defs = Defs() + Suite("s1"))
defs.s1 += [ Task("t{}".format(i)) for i in range(1,4) ]
defs.s1.t2 += [ Trigger("t1 == active and t3 == aborted"),
Complete("t3 == complete") ]