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

<archetype oid="00000000-0000-0000-0000-000000000508"
        xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:scext="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3">
    <name>Single action task</name>
    <archetypePolicy>
        <display>
            <label>
                <orig>Single action task</orig>
                <translation>
                    <key>SingleActionTask.title</key>
                </translation>
            </label>
            <pluralLabel>
                <orig>Single action tasks</orig>
                <translation>
                    <key>SingleActionTasks.title</key>
                </translation>
            </pluralLabel>
            <icon>
                <cssClass>fa fa-bullseye</cssClass>
                <color>green</color>
            </icon>
        </display>
        <itemConstraint id="1">
            <path>extension</path>
            <visibility>vacant</visibility>
        </itemConstraint>
        <itemConstraint id="2">
            <path>extension/scext:executeScript</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-noniterative-scripting</identifier>
                            <path>activity/work/nonIterativeScripting</path>
                        </container>
                    </panel>
                </panel>
                <panel id="4">
                    <identifier>taskBasic</identifier>
                    <container id="7">
                        <identifier>bulk-action</identifier>
                        <display>
                            <label>
                                <orig>Action</orig>
                                <translation>
                                    <key>SingleActionTask.action</key>
                                </translation>
                            </label>
                        </display>
                        <item id="8">
                            <c:path>extension/scext:executeScript</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>
