title = "automated failure recovery example"

description = """
Model task failure triggers diagnosis and recovery tasks, which
otherwise take themselves out of the suite if model succeeds.
Model post processing triggers off model or recovery tasks."""

[scheduling]
    initial cycle point = 20110101T00
    final cycle point = 20110101T12
    [[dependencies]]
        [[[T00, T12]]]
            graph = """
pre => model
model:fail => diagnose => recover
model => !diagnose & !recover
model | recover => post
post => !model # take out failed models if recovery succeeds
                    """
[runtime]
    [[model]]
        description = "A task that succeeds at T00 and fails at T12"
        script = """
echo Hello from $CYLC_TASK_ID
sleep 10
if [[ $(cylc util cycletime --print-hour) == 12 ]]; then
    echo "FAILING NOW!"
    /bin/false
else
    echo "Succeeded"
    /bin/true
fi"""
