| 1 |
.. _autocancel: |
| 2 |
|
| 3 |
autocancel |
| 4 |
////////// |
| 5 |
|
| 6 |
Autocancel is a way to automatically delete a node that has completed. |
| 7 |
The deletion may be delayed by an amount of time in hours and minutes or |
| 8 |
expression in days. This will help the maintenance of **living suites**. Notice that, if the suite is **repeated** and part of it is cancelled, that part will obviously not be run. |
| 9 |
|
| 10 |
The node deletion is never immediate. The nodes are checked once a |
| 11 |
minute (by default) and expired autocancel-nodes are deleted. |
| 12 |
|
| 13 |
Any node can have autocancel statement like: |
| 14 |
|
| 15 |
.. code-block:: shell |
| 16 |
|
| 17 |
autocancel +00:10 # Cancel 10 minutes later |
| 18 |
autocancel 0 # Cancel immediately |
| 19 |
autocancel 3 # Cancel three days later |
| 20 |
|
| 21 |
The effect of **autocancel** is the same as if the user would use: |
| 22 |
|
| 23 |
.. code-block:: shell |
| 24 |
|
| 25 |
ecflow_client –-delete=/path/to/node/with/autocancel |
| 26 |
|
| 27 |
This means the deleted nodes if used to trigger other nodes, may leave a |
| 28 |
node to wait for the (now missing) node. To solve this problem use a |
| 29 |
trigger like: |
| 30 |
|
| 31 |
.. code-block:: shell |
| 32 |
|
| 33 |
task t |
| 34 |
trigger node_name==complete or node_name==unknown |
| 35 |
|
| 36 |
It is best not to use autocancelled nodes in the triggers. |
| 37 |
|
| 38 |
Using autocancel |
| 39 |
==================== |
| 40 |
|
| 41 |
Sometimes you may want to have a suite in which you incrementally add |
| 42 |
things and once these parts have served their purpose you want to |
| 43 |
dispose of them. |
| 44 |
|
| 45 |
**autocancel** is a way of automatically removing these families. Nodes |
| 46 |
with this property defined will be automatically removed by ecFlow once |
| 47 |
they become complete and the time defined has elapsed. |
| 48 |
|
| 49 |
.. code-block:: shell |
| 50 |
|
| 51 |
suite x |
| 52 |
family fam |
| 53 |
autocancel +05:00 |
| 54 |
task t |
| 55 |
endfamily |
| 56 |
endsuite |
| 57 |
|
| 58 |
|
| 59 |
In this example family **fam** will be removed from the suite once it |
| 60 |
has been complete for more than five hours. |
| 61 |
|
| 62 |
This is equivalent to the user issuing the CLI command |
| 63 |
|
| 64 |
.. code-block:: shell |
| 65 |
|
| 66 |
ecflow_client –-delete=/x/fam |
| 67 |
|
| 68 |
This means that if there are other tasks dependent on **fam** or its |
| 69 |
children their triggers may never allow them to run. To guard against |
| 70 |
such situations you can use triggers that allow other nodes to disappear |
| 71 |
or that not been defined at all. This is done by using the status value |
| 72 |
unknown for undefined nodes. |
| 73 |
|
| 74 |
.. code-block:: shell |
| 75 |
|
| 76 |
suite x |
| 77 |
family fam |
| 78 |
autocancel +05:00 |
| 79 |
task t |
| 80 |
endfamily |
| 81 |
family ff |
| 82 |
trigger fam==complete or fam==unknown |