| 1 |
#!Jinja2 |
| 2 |
|
| 3 |
# a:x? => b => c |
| 4 |
# a:y? => d => e |
| 5 |
# |
| 6 |
# Start with the "x" pathway completed and re-trigger "a". |
| 7 |
# The second run of "a" yields the output "y". |
| 8 |
# |
| 9 |
# flow:1 |
| 10 |
# a(succeeded:x) |
| 11 |
# b(succeeded) |
| 12 |
# c(succeeded) |
| 13 |
# flow:<new> |
| 14 |
# a(running) |
| 15 |
# |
| 16 |
# by: |
| 17 |
# cylc trigger [--wait] a |
| 18 |
# |
| 19 |
# Result: |
| 20 |
# Task "a" is re-run, the workflow runs on from there following the "y" pathway. |
| 21 |
# (UNLESS --wait, in which case the y pathway doesn't run before shutdown). |
| 22 |
# |
| 23 |
# flow:1 |
| 24 |
# a#2 (the naturally triggered run) |
| 25 |
# a#2 (the manually triggered run) |
| 26 |
# b (the naturally triggered "x" pathway) |
| 27 |
# c (the naturally triggered "x" pathway) |
| 28 |
# d (the manually triggered "y" pathway) |
| 29 |
# e (the manually triggered "y" pathway) |
| 30 |
|
| 31 |
{% if WAIT is defined %} |
| 32 |
{% set OPT = "--wait" %} |
| 33 |
{% else %} |
| 34 |
{% set OPT = "" %} |
| 35 |
{% endif %} |
| 36 |
|
| 37 |
[scheduler] |
| 38 |
allow implicit tasks = True |
| 39 |
[[events]] |
| 40 |
abort on stall timeout = True |
| 41 |
stall timeout = PT0S |
| 42 |
abort on inactivity timeout = True |
| 43 |
inactivity timeout = PT1M |
| 44 |
|
| 45 |
[scheduling] |
| 46 |
[[graph]] |
| 47 |
R1 = """ |
| 48 |
a:x? => b => c |
| 49 |
a:y? => d => e |
| 50 |
""" |
| 51 |
[runtime] |
| 52 |
[[a]] |
| 53 |
script = """ |
| 54 |
if (( CYLC_TASK_SUBMIT_NUMBER == 1 )); then |
| 55 |
cylc message x |
| 56 |
else |
| 57 |
cylc message y |
| 58 |
fi |
| 59 |
""" |
| 60 |
[[[outputs]]] |
| 61 |
x = x |
| 62 |
y = y |
| 63 |
[[c]] |
| 64 |
script = """ |
| 65 |
if (( CYLC_TASK_SUBMIT_NUMBER == 1 )); then |
| 66 |
cylc trigger {{OPT}} ${CYLC_WORKFLOW_ID}//1/a |
| 67 |
cylc__job__poll_grep_workflow_log -E '1/a/02:running.*succeeded' |
| 68 |
fi |
| 69 |
""" |