[midPoint] Update CSV file based on administrative state?

Randall Smith rbsmith at adams.edu
Tue Nov 22 20:04:22 CET 2022


Thank you for your response. With your help, I was able to get it working.

administrativeStatus was always null. However, using effectiveStatus gave
me something to work with. I had read the Activation concept page but the
effective status section doesn't actually give the path for the
effectiveStatus attribute so I hadn't tried it.

For reference for people who find this thread later, here's my attribute.

            <attribute id="47">
                <ref>ri:DeleteAccount</ref>
                <tolerant>false</tolerant>
                <exclusiveStrong>false</exclusiveStrong>
                <outbound>
                    <authoritative>false</authoritative>
                    <exclusive>false</exclusive>
                    <strength>strong</strength>
                    <source>
                        <path>activation/administrativeStatus</path>
                    </source>
                    <source>
                        <path>activation/effectiveStatus</path>
                    </source>
                    <expression>
                        <script>
                            <code>
import
com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;
log.info("Admin Status: " + administrativeStatus + " Disabled: " +
ActivationStatusType.DISABLED + " Effective: " + effectiveStatus);
if (   effectiveStatus == ActivationStatusType.DISABLED
    || effectiveStatus == ActivationStatusType.ARCHIVED
    ) {
    log.info("User is disabled");
    return "Y";
}
else {
   log.info("User is active");
   return "N";
}

    </code>
                        </script>
                    </expression>
                </outbound>
            </attribute>

On Tue, Nov 22, 2022 at 4:36 AM Fabian Noll-Dukiewicz
<fabian.noll-dukiewicz at veryfy.gmbh> wrote:

> Hi Randall,
>
> I think it is not necessary to use script expression to get the
> administrative status in an outbound mapping. You can access the users
> attributes values using the <source> element. It could also useful to use
> effectiveStatus instead of administrativeStatus. (see documentation
> <https://docs.evolveum.com/midpoint/reference/concepts/activation/#:~:text=The%20effective%20status%20is%20the%20property%20that%20is%20used%20by,haven't%20taken%20place%20yet.>
> )
>> <outbound>
>   <source>
>     <c:path>activation/administrativeStatus</c:path>
>   </source>
>   <expression>
>     <script>
>       <code>
>         //do your stuff
>
> import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;
>       if(administrativeStatus == ActivationStatusType.DISABLED) {
>         log.info("User is disabled.");
>         return "0";
>       } else {
>         log.info("User is active.");
>         return "1";
>       }
>       </code>
>     </script>
>   </expression>
> Good luck!
>
> Kind regards,
> Fabian
>
> *Fabian Noll-Dukiewicz*
>
> *Spezialist Identity & Access Management | Geschäftsführer*
>
> Tel.: +49 152 244 63 211
>
> Email: fabian at veryfy.gmbh
>
> Web: https://veryfy.gmbh
> <https://veryfy.gmbh/>
> veryfy GmbH - Identity Management neugedacht <https://veryfy.gmbh/>
> Wir machen Ihr SAP System sicher: Von der Beratung über die Konzeption bis
> hin zur Umsetzung und dem Betrieb Ihrer Identity Management Lösung.
> veryfy.gmbh
>
>
> ------------------------------
> *Von:* Randall Smith <rbsmith at adams.edu>
> *Gesendet:* Freitag, 18. November 2022 17:55
> *An:* midpoint at lists.evolveum.com <midpoint at lists.evolveum.com>
> *Betreff:* [midPoint] Update CSV file based on administrative state?
>
> Greetings,
>
> I have a CSV file that's being uploaded to a third party. One of the
> fields needs to change based on the activation state.
>
> I tried using focus?.getActivation()?.getAdministrativeStatus() in the
> outbound attribute of schemahandling but it was always null.
>
> What's the right way to change an outbound value for a CSV file based on
> the administrative status?
>
> --
> Randall Smith
> Sr. Systems Administrator / Architect
> Adams State University
> http://www.adams.edu/
> 719-587-7741
>


-- 
Randall Smith
Sr. Systems Administrator / Architect
Adams State University
http://www.adams.edu/
719-587-7741
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20221122/efc15c6c/attachment.htm>


More information about the midPoint mailing list