<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2024 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->


<!--

This file provides a set of tasks demonstrating basic task scheduling
and task management operations. You can import it and watch how tasks
are scheduled; then you can try to manage (suspend, resume, edit, delete)
these tasks via admin GUI.

-->

<objects xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-48e2-86d6-3d4f02d3e1a2"
         xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
         xmlns:noop="http://midpoint.evolveum.com/xml/ns/public/task/noop/handler-3"
         xsi:schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-3 ../../infra/schema/src/main/resources/xml/ns/public/common/common-3.xsd">

    <task oid="00000000-0000-0000-0000-123450000001">
        <name>Task1: basic single-run task (takes 3x60 sec)</name>
        <activity>
            <work>
                <noOp>
                    <delay>60000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>3</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000001</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>
        <schedule>
            <recurrence>single</recurrence>
        </schedule>
        <binding>tight</binding>
    </task>

    <task oid="00000000-0000-0000-0000-123450000002">
        <name>Task2: interval-based recurrent, tightly bound (every 20 sec, takes 2x4 sec)</name>
        <activity>
            <work>
                <noOp>
                    <delay>4000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>2</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000002</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>

        <binding>tight</binding>
        <schedule>
            <recurrence>recurring</recurrence>
            <interval>20</interval>
        </schedule>
    </task>

    <task oid="00000000-0000-0000-0000-123450000003">
        <name>Task3: interval-based recurrent, loosely bound (every 60 sec, takes 3x10 sec)</name>
        <activity>
            <work>
                <noOp>
                    <delay>10000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>3</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000003</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>

        <binding>loose</binding>
        <schedule>
            <recurrence>recurring</recurrence>
            <interval>60</interval>
        </schedule>
    </task>

    <task oid="00000000-0000-0000-0000-123450000004">
        <name>Task4: cron-based recurrent, loosely bound (every minute, takes 3x10 sec)</name>
        <activity>
            <work>
                <noOp>
                    <delay>10000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>3</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000004</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>

        <binding>loose</binding>
        <schedule>
            <recurrence>recurring</recurrence>
            <cronLikePattern>0 * * * * ?</cronLikePattern>
        </schedule>
    </task>

    <task oid="00000000-0000-0000-0000-123450000005">
        <name>Task5: cron-based recurrent, loosely bound (every 5 minutes, takes 3x20 sec)</name>
        <activity>
            <work>
                <noOp>
                    <delay>20000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>3</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000005</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>

        <binding>loose</binding>
        <schedule>
            <recurrence>recurring</recurrence>
            <cronLikePattern>0 0/5 * * * ?</cronLikePattern>
        </schedule>
    </task>

    <task oid="00000000-0000-0000-0000-123450000006">
        <name>Task6: cron-based, loosely bound, non-resilient, reschedule on misfire (3x20 sec a 5min)</name>
        <activity>
            <work>
                <noOp>
                    <delay>20000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>3</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000006</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>

        <binding>loose</binding>
        <schedule>
            <recurrence>recurring</recurrence>
            <cronLikePattern>0 0/5 * * * ?</cronLikePattern>
            <misfireAction>reschedule</misfireAction>
        </schedule>
        <threadStopAction>close</threadStopAction>
    </task>

    <task oid="00000000-0000-0000-0000-123450000007">
        <name>Task7: non-resilient single-run task (20x5 sec)</name>
        <activity>
            <work>
                <noOp>
                    <delay>5000</delay>    <!--  delay simulates a non-interruptible processing -->
                    <steps>20</steps>        <!--  at the end of each step, the NoOp handler looks for shutdown signal -->
                </noOp>
            </work>
        </activity>
        <taskIdentifier>10000000-0000-0000-0000-123450000007</taskIdentifier>
        <ownerRef oid="00000000-0000-0000-0000-000000000002"/>
        <executionStatus>runnable</executionStatus>

        <binding>tight</binding>
        <schedule>
            <recurrence>single</recurrence>
            <earliestStartTime>2012-05-09T06:30:00</earliestStartTime>
        </schedule>
        <threadStopAction>suspend</threadStopAction>
    </task>

</objects>
