#!jinja2

[scheduler]
    cycle point format = %Y
    UTC mode = True

[scheduling]
    initial cycle point = 2016
    final cycle point = 2018
    [[graph]]
        P1Y = t1[-P1Y]:start => t1 & t2

[runtime]
    [[t1]]
        script = """
            # Final task runs the show. The other wait after starting.
            if [[ "${CYLC_TASK_CYCLE_POINT}" == '2018' ]]; then
                # Ensure workflow knows about current task started
                cylc__job__wait_cylc_message_started
                sleep 5
                cylc show "${CYLC_WORKFLOW_ID}//*/t1" \
                    >"${CYLC_WORKFLOW_RUN_DIR}/show.txt"
                cylc show --task-def=t1 --task-def=t2 "${CYLC_WORKFLOW_ID}" \
                    >"${CYLC_WORKFLOW_RUN_DIR}/show2.txt"
            else
                while [[ ! -s "${CYLC_WORKFLOW_RUN_DIR}/show.txt" ]]; do
                    sleep 1
                done
            fi
        """
        execution time limit = PT1M
    [[t2]]
        [[[meta]]]
           title = beer
           description = better than water
           URL = beer.com
           abv = 12%
