Page tree
Skip to end of metadata
Go to start of metadata

MidPoint 4.2 and later

Limited feature

This is a limited midPoint feature. This feature currently supports only some specific use-cases. We are perfectly capable to finish the feature, just the funding for the work is needed. Please consider the possibility for supporting development of this feature by using midPoint Platform subscription. If you are midPoint Platform subscriber and this feature is within the goals of your deployment you may be able to use your subscription to endorse implementation of this feature.

A task is said to be orphaned if it has a link to a parent (its parent property that contains the identifier of the parent is not null) but no task with given identifier value exists.

We want to do various things with orphaned tasks: at least we need to see them and to delete them - in an automated way, if possible.

Unfortunately, current midPoint query API does not allow us to specify a query that would return a list of orphaned tasks. Therefore we had to devise an alternate way.

We have chosen to employ policySituation property that is generally useful for such cases. In this property we store a value of if and only if the task is orphaned. This is ensured by appropriate policy rule.

Therefore, to mark orphaned tasks as such, one has to provide two things:

  1. a policy rule that provides the marking,
  2. a task that would regularly go through all the tasks and update their policy situation.

The policy rule

Generally, policy rules can be assigned or global. In this particular case, global policy rule is the easiest to use. The following is to be included in the system configuration object:

Global policy rule that sets "orphaned" policy situation

The task that updates policy situation

The following task will update policy situation for tasks. It does a very lightweight "recompute" by skipping everything except for policy rule processing.

Task that updates policy situation for tasks
<task xmlns=""
    <name>Mark orphaned tasks</name>
    <extension xmlns:mext="">
    <assignment id="1">
        <targetRef oid="00000000-0000-0000-0000-000000000502" relation="org:default" type="c:ArchetypeType">
            <!-- Recomputation task -->
    <ownerRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
        <!-- administrator -->

Of course, the recurrence should be set appropriately, to run e.g. once a day.

GUI configuration to display orphaned tasks

To display orphaned tasks in GUI, you can configure object collection with the filter for orphaned tasks.

Object collection looks like

Orphaned tasks object collection
<objectCollection xmlns="" xmlns:c="" xmlns:icfs="" xmlns:org="" xmlns:q="" xmlns:ri="" xmlns:t="" oid="32456589-1122-1643-2751-469323287545" version="10">
    <name>Orphaned tasks</name>
        <collectionRef oid="00000000-0000-0000-0001-000000000007" relation="org:default" type="c:ObjectCollectionType">
            <!-- All tasks -->

To add menu item for Orphaned tasks collection to the Server tasks section, add the following configuration to  the system configuration.

Orphaned tasks menu item configuration
                                <collectionRef oid="32456589-1122-1643-2751-469323287545" relation="org:default" type="c:ObjectCollectionType">
                                    <!-- Orphaned tasks -->

  • No labels