<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Hi Randall,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
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.
 (<a href="https://docs.evolveum.com/midpoint/reference/concepts/activation/#:~:text=The%20effective%20status%20is%20the%20property%20that%20is%20used%20by,haven't%20taken%20place%20yet." title="https://docs.evolveum.com/midpoint/reference/concepts/activation/#:~:text=The%20effective%20status%20is%20the%20property%20that%20is%20used%20by,haven't%20taken%20place%20yet.">see
 documentation</a>)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="background-color: transparent;">​
<table cellspacing="0" cellpadding="1" data-editing-info="{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"keepCellShade":false}" style="border-collapse: collapse;">
<tbody>
<tr>
<td style="width: 120px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); background-color: transparent;" scope="" class="ContentPasted0">
<outbound><br>
  <source><br>
    <c:path>activation/administrativeStatus</c:path><br>
  </source><br>
  <expression><br>
    <script><br>
      <code><br>
        //do your stuff<br>
        import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;<br>
      if(administrativeStatus == ActivationStatusType.DISABLED) {<br>
        log.info("User is disabled.");<br>
        return "0";<br>
      } else {<br>
        log.info("User is active.");<br>
        return "1";<br>
      }<br>
      </code><br>
    </script><br>
  </expression></td>
</tr>
</tbody>
</table>
</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Good luck!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Kind regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Fabian</div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="color:rgb(32, 31, 30);text-align:start;background-color:rgb(255, 255, 255);font-size:11pt;font-family:Calibri, sans-serif;margin:0px">
<b><span style="font-size:10pt;font-family:Verdana, sans-serif;margin:0px;color:black">Fabian Noll-Dukiewicz</span></b><b><span style="font-family:Verdana, sans-serif;margin:0px;color:black"></span></b></p>
<p style="color:rgb(32, 31, 30);text-align:start;background-color:rgb(255, 255, 255);font-size:11pt;font-family:Calibri, sans-serif;margin:0px">
<i><span style="font-size:10pt;font-family:Verdana, sans-serif;margin:0px;color:black">Spezialist Identity & Access Management | Geschäftsführer</span></i></p>
<p style="color:rgb(32, 31, 30);text-align:start;background-color:rgb(255, 255, 255);font-size:11pt;font-family:Calibri, sans-serif;margin:0px">
<span lang="en-US" style="font-size:10pt;font-family:Verdana, sans-serif;margin:0px;color:black">Tel.: +49 152 244 63 211</span></p>
<p style="color:rgb(32, 31, 30);text-align:start;background-color:rgb(255, 255, 255);font-size:11pt;font-family:Calibri, sans-serif;margin:0px">
<span lang="en-US" style="font-size:10pt;font-family:Verdana, sans-serif;margin:0px;color:black">Email:
<a href="mailto:fabian@veryfy.gmbh" title="mailto:fabian@veryfy.gmbh">fabian@veryfy.gmbh</a></span></p>
<p style="color:rgb(32, 31, 30);text-align:start;background-color:rgb(255, 255, 255);font-size:11pt;font-family:Calibri, sans-serif;margin:0px">
<span style="font-size:10pt;font-family:Verdana, sans-serif;margin:0px;color:black">Web:<span style="margin:0px"> <a href="https://veryfy.gmbh" id="LPlnkOWALinkPreview">https://veryfy.gmbh</a> </span></span></p>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1">
<div id="LPBorder_GTaHR0cHM6Ly92ZXJ5ZnkuZ21iaC8." class="LPBorder774455" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer774455" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer774455" style="position: relative; margin-right: 12px; height: 160px; overflow: hidden; width: 240px;">
<a target="_blank" id="LPImageAnchor774455" href="https://veryfy.gmbh/"><img id="LPThumbnailImageId774455" alt="" height="160" style="display: block;" width="240" src="https://veryfy.gmbh/wp-content/uploads/2021/10/FNDIT_Notizen_vor_dem_Macbook.jpg"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle774455" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor774455" href="https://veryfy.gmbh/" style="text-decoration: none; color: var(--themePrimary);">veryfy GmbH - Identity Management neugedacht</a></div>
<div id="LPDescription774455" style="font-size: 14px; max-height: 100px; color: rgb(102, 102, 102); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden;">
Wir machen Ihr SAP System sicher: Von der Beratung über die Konzeption bis hin zur Umsetzung und dem Betrieb Ihrer Identity Management Lösung.</div>
<div id="LPMetadata774455" style="font-size: 14px; font-weight: 400; color: rgb(166, 166, 166); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">
veryfy.gmbh</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Randall Smith <rbsmith@adams.edu><br>
<b>Gesendet:</b> Freitag, 18. November 2022 17:55<br>
<b>An:</b> midpoint@lists.evolveum.com <midpoint@lists.evolveum.com><br>
<b>Betreff:</b> [midPoint] Update CSV file based on administrative state?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_gmail_default" style="font-family:monospace,monospace">Greetings,<br clear="all">
</div>
<div class="x_gmail_default" style="font-family:monospace,monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace,monospace">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.</div>
<div class="x_gmail_default" style="font-family:monospace,monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace,monospace">I tried using focus?.getActivation()?.getAdministrativeStatus() in the outbound attribute of schemahandling but it was always null.</div>
<div class="x_gmail_default" style="font-family:monospace,monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace,monospace">What's the right way to change an outbound value for a CSV file based on the administrative status?</div>
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Randall Smith<br>
</div>
Sr. Systems Administrator / Architect<br>
Adams State University<br>
<a href="http://www.adams.edu/" data-auth="NotApplicable">http://www.adams.edu/</a><br>
719-587-7741<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>