<div dir="ltr">Hi Jason,<div><br></div><div>please try in this way</div><div><br></div><div><div> <attribute></div><div> <c:ref><b>ri:currentLevel</b></c:ref> <!-- as 'input' in expression --></div><div> <inbound></div><div> <strength>strong</strength></div><div> <source></div><div> <c:path>$account/attributes/<b>ri:currentStatus</b></c:path></div><div> </source></div><div> <expression><br></div><div> <script></div><div> <code></div><div> import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;</div><div><br></div><div> if (<b>input </b>== 'FAC' && <b>currentStatus </b>== 'ACTIVE') {<br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span> return ActivationStatusType.ENABLED;</div><div> } else if (<b>input </b>== 'FAC' && <b>currentStatus </b>== 'RETIRED'){</div><div> <span class="gmail-Apple-tab-span" style="white-space:pre"> </span> return ActivationStatusType.DISABLED;</div><div> }</div><div> // and so on...</div><div><br></div><div> return ActivationStatusType.DISABLED;</div><div> </code></div><div> </script></div><div> </expression></div><div> <b> <target></b></div><div><b> <c:path>activation/administrativeStatus</c:path></b></div><div><b> </target></b></div><div> </inbound><br></div><div> </attribute></div></div><div><br></div><div>best regards,</div><div><br></div><div>Gustav</div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-03 18:36 GMT+01:00 Jason Everling <span dir="ltr"><<a href="mailto:jeverling@bshp.edu" target="_blank">jeverling@bshp.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am redesigning one of our main resources from a csv feed to a scriptedsql resource, 'because I created it a long time ago in a rush to get it going :( '<div><br></div><div>When using activation, can operators be used or is there another way to handle it?</div><div><br></div><div>Currently, in order for a user to be considered 'active' there must be 2 conditions true</div><div><br></div><div>currentLevel == 'FAC' && currentStatus == 'ACTIVE' would be considered 'enabled'</div><div><br></div><div>currentLevel == 'FAC' && currentStatus == 'RETIRED' would be considered 'disabled'<br></div><div><br></div><div>so on and so on.....</div><div><br></div><div>Question is, can I use expressions/script/code for activation/<wbr>administrativeStatus in the resource xml? Maybe like the below as an example of how? </div><div><br></div><div><div> <administrativeStatus></div><div> <inbound></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><strength>strong</strength></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><source></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><path>$shadow/attributes/ri:<wbr>currentLevel</path></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></source></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><source></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><path>$shadow/attributes/ri:<wbr>currentStatus</path></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></source></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><expression></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><script></div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span><code></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>import com.evolveum.midpoint.xml.ns._<wbr>public.common.common_3.<wbr>ActivationStatusType;</div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>if (currentLevel == 'STU' && currentStatus == 'Freshman') {</div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>ActivationStatusType.ENABLED;</div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} else if (currentLevel == 'FAC' && currentStatus == 'Active'){</div><div> <span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} else if (.....) {</div><div><div> } else if (.....) {</div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} else if (.....) {</div></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} else {</div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>ActivationStatusType.DISABLED;</div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></code></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></script></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></expression></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></inbound></div><div><span class="gmail-m_1713568962728860234gmail-Apple-tab-span" style="white-space:pre-wrap"> </span></administrativeStatus></div></div><div><br></div><div>Thanks!</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div><div><div class="gmail-m_1713568962728860234gmail-m_8788949712117547557gmail_signature"><div dir="ltr">JASON</div></div></div>
</div></font></span></div>
<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Gustáv Pálos</div><div>Identity Engineer</div><a href="http://evolveum.com/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">evolveum.com</a><br></div></div>
</div></div>