File: adding_externs_automatically.rst

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (26 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.. _adding_externs_automatically:

Adding externs automatically
////////////////////////////

Extern refers to nodes that have not yet been defined typically due to
cross suite dependencies. Trigger and complete expressions may refer
to paths and variables in other suites that have not been loaded yet.
The references to node paths and variables must exist or exist as
externs. Externs can be added manually or automatically

- Manual Method:

  .. code-block:: python

      defs = ecflow.Defs("file.def") # open and load file 'file.def' into memory
      defs.add_extern("/temp/bill:event_name")


- Automatic Method; this will scan all trigger and complete expressions, looking for paths and variables that have not been defined. The added benefit of this approach is that duplicates will not be added. It is the user's responsibility to check that extern's are eventually defined otherwise trigger expression will not evaluate correctly

  .. code-block:: python
    
      defs = ecflow.Defs("file.def") # open and load file 'file.def' into memory
      ...
      defs.auto_add_extern(True) # True means remove existing extern first.