<!--
  ~ Copyright (c) 2020 Evolveum and contributors
  ~
  ~ Licensed under the EUPL-1.2 or later.
  -->

<archetype oid="00000000-0000-0000-0000-000000000506"
        xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
    <name>Cleanup task</name>
    <archetypePolicy>
        <display>
            <label>
                <orig>Cleanup task</orig>
                <translation>
                    <key>CleanupTask.label</key>
                </translation>
            </label>
            <pluralLabel>
                <orig>Cleanup tasks</orig>
                <translation>
                    <key>CleanupTasks.title</key>
                </translation>
            </pluralLabel>
            <icon>
                <cssClass>fa fa-trash-alt</cssClass>
                <color>green</color>
            </icon>
        </display>
        <itemConstraint id="1">
            <path>extension</path>
            <visibility>vacant</visibility>
        </itemConstraint>
        <itemConstraint id="2">
            <path>extension/mext:cleanupPolicies</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <adminGuiConfiguration>
            <objectDetails>
                <type>TaskType</type>
                <panel id="3">
                    <identifier>activity</identifier>
                    <panel id="5">
                        <identifier>work</identifier>
                        <container id="6">
                            <identifier>work-cleanup</identifier>
                            <path>activity/work/cleanup</path>
                        </container>
                    </panel>
                </panel>
                <panel id="4">
                    <identifier>taskBasic</identifier>
                    <container id="7">
                        <identifier>cleanup-options</identifier>
                        <display>
                            <label>CleanupTask.cleanupOptions</label>
                        </display>
                        <item id="8">
                            <c:path>extension/mext:cleanupPolicies</c:path>
                        </item>
                    </container>
                </panel>
            </objectDetails>
        </adminGuiConfiguration>
    </archetypePolicy>
    <assignment id="9">
        <identifier>holderType</identifier>
        <assignmentRelation id="10">
            <holderType>TaskType</holderType>
        </assignmentRelation>
    </assignment>
    <inducement id="11">
        <identifier>nameMapping</identifier>
        <focusMappings>
            <mapping id="12">
                <strength>weak</strength>
                <expression>
                    <script>
                        <code>
                            return source.name
                        </code>
                    </script>
                </expression>
                <target>
                    <path>name</path>
                </target>
            </mapping>
        </focusMappings>
    </inducement>
</archetype>
