[midPoint] Problems with Import report

Chris Woods Chris.Woods at rohde-schwarz.com
Wed Mar 3 16:58:15 CET 2021


Hi,
I am using the import report that was written by Evolveum for us for 4.2 (https://wiki.evolveum.com/display/midPoint/Report+Configuration). I'm having trouble assigning archetypes via this report. I have the following code for the archetype column:

<column>
    <name>archetypeOid</name>
    <path>assignment</path>
    <display>
        <label>AssignmentOid</label>
        <tooltip>Specify the type of role to be created by entering the archetype here</tooltip>
    </display>
    <import>
        <expression>
            <script>
               <code><![CDATA[
                    import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
                    import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
                    import com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypeType;

                    List<AssignmentType> assignments = new ArrayList();

                    for (String oid : input) {
                        if (oid != null) {

                            ObjectReferenceType archetypeRef = new ObjectReferenceType();
                            archetypeRef.setType(ArchetypeType.COMPLEX_TYPE);
                            archetypeRef.setOid(oid);

                            AssignmentType assignment = new AssignmentType();
                            assignment.asPrismContainerValue();
                            assignment.setTargetRef(archetypeRef);
                            assignments.add(assignment);
                        }
                    }

                    return assignments;
                    ]]></code>
            </script>
        </expression>
    </import>
    <previousColumn>name</previousColumn>
</column>

but this is only "half" assigning the archetype. there is an assignment (as expected), but archetypeRef and roleMembershipRef are missing. Because of this, the generation of the "name" attribute doesn't work (this is programmatically calculated in the archetype itself). Does anyone know what I'm doing wrong?
I've used similar code in other places and the archetype is assigned correctly.
Thanks in advance.
Regards,
Chris

CHRIS WOODS
Identity Management
Information and Business Technology

Rohde & Schwarz GmbH & Co. KG
Mühldofstraße 15| 81671 München
Telefon: +49 89 4129 15735
Internet: https://www.rohde-schwarz.com<https://www.rohde-schwarz.com/>




Content provided within this e-mail including any attachments, is for the use of the intended recipients and may contain Rohde & Schwarz company restricted information. Any unauthorized use, disclosure, or distribution of this communication in whole or in part is strictly prohibited. If you are not the intended recipient, please notify the sender by reply email or by telephone and delete the communication in its entirety.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20210303/04d4bc62/attachment-0001.htm>


More information about the midPoint mailing list