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 2 Next »

Currently the ecflow python api provides quite extensive functionality. However sometimes we just want to query simple state , and using the full blown python api, can seem like an overkill. Query can be used in these simple cases

Query the status of attributes i.e. state, event, meter, variable or trigger expression without blocking

  • state    return   [unknown | complete | queued  |  aborted | submitted | active] to standard out
  • dstate   return [unknown | complete | queued  |  aborted | submitted | active | suspended] to standard out
  • event    return 'set' | 'clear' to standard out
  • meter    return value of the meter to standard out
  • variable return value of the variable, repeat or generated variable to standard out, will search up the node tree
  • trigger  returns 'true' if the expression is true, otherwise 'false'\n\n"

 If this command is called within a '.ecf' script we will additionally log the task calling this command

This is required to aid debugging for excessive use of this command

 The command will fail if the node path to the attribute does not exist in the definition and if:

  • event    The event is not found
  • meter    The meter is not found\
  • variable No user or generated variable or repeat of that name found on node, or any of its parents
  • trigger  Trigger does not parse, or reference to nodes/attributes in the expression are not valid\n"

  Arguments:

  • arg1 = [ state | event | meter | variable | trigger ]
  • arg2 = <path> | <path>:name where name is name of a event, meter or variable
  • arg3 = trigger expression (optional)

Usage:

  • ecflow_client --query state /path/to/node                                                           # return node state to standard out
  • ecflow_client --query dstate /path/to/node                                                        # state that can includes suspended
  • ecflow_client --query event /path/to/task/with/event:event_name     # return set | clear to standard out
  • ecflow_client --query meter /path/to/task/with/meter:meter_name   # returns the current value of the meter to standard out
  • ecflow_client --query variable /path/to/task/with/var:var_name            # returns the variable value to standard out
  • ecflow_client --query trigger /path/to/node/with/trigger \"/suite/task == complete\"   # return true if expression evaluates false otherwise

           

  • No labels