ecFlow's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

The following python code shows how to check expression and limits.
Checking existing definition file that has been saved as a file;

 def = ecflow.Defs("/my/path.def") # will load file '/my/path.def' from disk
 print def.check() # check trigger expressions and limits


Here is another example where we create the suite definition on the fly. In fact using the python API allows for a correct by construction paradigm.

 defs = ecflow.Defs()                  # create a empy defs
 suite = defs.add_suite("s1");         # create a suite 's1' and add to defs
 task = suite.add_task("t1");          # create a task 't1' and add to suite
 task.add_trigger("t2 == active)")     # mismatched brackets
 result = defs.check();                # check trigger expressions and limits
 print "Message: '" + result + "'"
 assert len(result) != 0, "Expected Error: mis-matched brackets in expression." 
  • No labels