ecflow_client --abort=trap # Notify ecFlow that something went # wrong, using 'trap' as the reason trap 0 # Remove the trap exit 0 # End the script } # Trap any calls to exit and errors caught by the -e flag trap ERROR 0 # Trap any signal that may cause the script to fail trap '{ echo "Killed by a signal"; ERROR ; }' 1 2 3 4 5 6 7 8 10 12 13 15""" deploy(head, include + "head.h") ##################################################################### tail = """wait # wait for background process to stop ecflow_client --complete # Notify ecFlow of a normal end trap 0 # Remove all traps exit 0 # End the shell""" deploy(tail, include + "tail.h") ##################################################################### # loading a node into ecflow server defs = Defs() defs.add_suite(suite) HOST = os.getenv("ECF_HOST", "localhost") PORT = os.getenv("ECF_PORT", "2500") client = Client(HOST, PORT) path = '/%s' % suite.name() client.replace(path, defs) print("#\n#MSG: node", path, "is now replaced on", HOST, PORT)
Task("t3").add(Trigger("t2:a")), Task("t4").add(Complete("t2:b"), Trigger("t2 eq complete and not t2:b"))), Family("f2").add( Task("t1").add(Time("00:30 23:30 00:30")), Task("t2").add(Day("sunday")), Task("t3").add(Time("12:00"), Date("1.*.*")), Task("t4").add(Time("+00:02")), Task("t5").add(Time("00:02")))) if __name__ == "__main__": SUITE = create() if True: import fif import el52_block_case as case import el53_block_daily as daily import el54_block_for as ffor SUITE.add( Family("visualise").add(fif.family_if(), case.family_case(), daily.process(), ffor.family_for())) DEFS = Defs() DEFS.add_suite(SUITE) CLIENT = ecflow.Client(os.getenv("ECF_HOST", "localhost"), os.getenv("ECF_PORT", 2500)) DEFS.generate_scripts() RESULT = DEFS.simulate() print(RESULT) NODE = '/' + SUITE.name() CLIENT.replace("/%s" % NODE, DEFS)
Time("00:02")))) if __name__ == "__main__": NAME = os.getenv("SUITE", "elearning") DEFS = Defs() SUITE = create(NAME) if True: import ex1, ex1s, ex2, ex2s, ex3, ex4 SUITE.add(Family("exercises").add( ex1.time_and_dates(), ex2.cron_clean(), ex3.time_event(), Family("priorityP").add(ex4.priority()), Family("priorityS").add(ex4.priority_limit()), )) DEFS.add_suite(ex2s.ex2("repeat_clean")) if True: import limit, limit2, fif, ffor, case import el58_produce_consume as produce SUITE.add( Family("visualise").add( produce.call_consumer(NAME + "/visualise"), limit.family_limit(), limit.family_limiter(), fif.family_if(), ffor.family_for(), case.family_case())) print(DEFS) DEFS.add_suite(SUITE) DEFS.generate_scripts() DEFS.simulate()