#!jinja2
{%- set TEST_DIR = environ['TEST_DIR'] %}
[scheduler]
    UTC mode = True
    [[events]]
        abort on stall timeout = True
        stall timeout = PT3M
[scheduling]
    initial cycle point = 20130923T00
    final cycle point   = 20130926T00
    [[graph]]
        PT12H = """
            foo[-PT12H] => foo => bar
            bar[-P1D] => bar
        """
        R1/20130925T0000Z = """
            bar[-P1D] & bar[-PT12H] & foo[-PT12H] => shutdown => output_states
            output_states => foo => bar
        """
[runtime]
    [[foo,bar]]
        script = """
            sleep 1
        """
        [[[meta]]]
            description = "Placeholder tasks for dependencies"
    [[OUTPUT]]
        script = """
            sleep 5
            ctb-select-task-states \
                "${CYLC_WORKFLOW_RUN_DIR}" "${CYLC_TASK_NAME}" \
                > "${CYLC_WORKFLOW_RUN_DIR}/$OUTPUT_SUFFIX-db"
        """
    [[shutdown]]
        inherit = OUTPUT
        post-script = """
            cylc shutdown $CYLC_WORKFLOW_ID
            sleep 5
        """
        [[[meta]]]
            description = "Force a shutdown of the workflow"
        [[[environment]]]
            OUTPUT_SUFFIX=pre-restart
    [[output_states]]
        inherit = OUTPUT
        pre-script = """
            sleep 5
        """
        [[[meta]]]
            description = "Wait for the restart to complete, then output states"
        [[[environment]]]
            OUTPUT_SUFFIX=post-restart
