Actions

Last modified 22 Apr 2021 17:31 +02:00
EXPERIMENTAL
This feature is experimental. It means that it is not intended for production use. The feature is not finished. It is not stable. The implementation may contain bugs, the configuration may change at any moment without any warning and it may not work at all. Use at your own risk. This feature is not covered by midPoint support. In case that you are interested in supporting development of this feature, please consider purchasing midPoint Platform subscription.
Since 4.2
This functionality is available since version 4.2.

Introduction

MidPoint Scripting Language (a.k.a "bulk actions") traditionally have two kinds of components: "actions" and "others". The former ones have been devised to do something on input objects: modify them, enable/disable them, assign roles or resources to them, and so on. The latter components have been created to do everything other: to search repository for objects (to be applied actions to), to structure the flow to pipelines or sequences, or to manipulate the objects being passed between components somehow, typically by filtering the content by removing (or keeping) specified items.

The original specification of actions and their parameters was quite powerful - parameters could be computed dynamically using other bulk actions - but also awkward to use.

So we decided to add an option of simple specification of action parameters. So, for example, instead of writing:

<s:pipeline>
    <s:search>
        <s:type>UserType</s:type>
    </s:search>
    <s:action>
        <s:type>execute-script</s:type>
        <s:parameter>
            <s:name>script</s:name>
            <c:value xsi:type="c:ScriptExpressionEvaluatorType">
                <code>
                    ...
                </code>
            </c:value>
        </s:parameter>
        <s:parameter>
            <s:name>forWholeInput</s:name>
            <c:value>false</c:value>
        </s:parameter>
        <s:parameter>
            <s:name>quiet</s:name>
            <c:value>true</c:value>
        </s:parameter>
    </s:action>
</s:pipeline>

one can simply write

<s:pipeline>
    <s:search>
        <s:type>UserType</s:type>
    </s:search>
    <s:execute>
        <s:script>
            <code>
                ...
            </code>
        </s:script>
        <s:forWholeInput>false</s:forWholeInput>
        <s:quiet>true</s:quiet>
    </s:execute>
</s:pipeline>

Moreover, we can rely on all the auto-completion and schema-checking features of modern IDEs, because the definition of s:execute element and its parameters is fully described in relevant XML schema document.

Actions

The actions themselves are the same as they were before midPoint 4.2. In some cases, the action names were clarified. In other ones, parameters were reorganized into more logical way. But the backward compatibility is fully ensured: the old way of specifying actions is still possible; although it will be probably deprecated (and removed) in the future.

Action Description

add

Adds object(s) to the repository.

modify

Modifies object(s).

delete

Deletes object(s).

enable, disable

Enables or disables object(s).

assign

Assigns an abstract role or a resource to object(s).

unassign

Removes assignment(s) from object(s).

recompute

Recomputes object(s) (or schedules the recomputation to the future).

execute

Executes a script against the input data.

resumeTask

Resumes suspended task(s).

resolveReference

Resolves reference(s).

applyDefinition

Applies definition to shadows or resources.

purgeSchema

Removes all schema information from given resource(s).

testResource

Tests resource(s).

generateValue

Generates value(s) for object(s).

notify

Sends a custom notification event for objects.

log

Logs the input data.

The following actions were not changed and are accessible only in the traditional way:

Action Description

discover-connectors

Discovers all connectors on given connector host(s).

validate

Validates resource(s) - i.e. provides a set of issues just like in Resource Wizard (since 3.5)