<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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);">
<br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Hi,
<div class="ContentPasted0">I'm using CSV file to create a org tree and assign a manager to each one. But when there are a change in manager, the new manager is added and the old manager is not removed.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">Like in the book, the org CSV has orgnum, orgname, and manager identifier. I made two resources, one to build the org tree, and another to assign manager to the orgs.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">The resource that assigns manager to the orgs has a assignmentTargetSearch to find the org and change the assignment attribute of the user. So, when a user is no more manager of an org, his identifier disappear from the CSV file.</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">What is the correct way to do this?</div>
<div><br class="ContentPasted0">
</div>
<div>My CSV org file is like:</div>
<div>orgnum,orgname,orgmanager</div>
<div><br>
</div>
<div>My schemahandling:</div>
<div class="ContentPasted1"><schemaHandling>
<div class="ContentPasted1">            <objectType></div>
<div class="ContentPasted1">                <displayName>Organizational Unit Manager</displayName></div>
<div class="ContentPasted1">                <objectClass>ri:AccountObjectClass</objectClass></div>
<div class="ContentPasted1">                <kind>account</kind><br>
</div>
                <default>true</default>
<div class="ContentPasted1">                <attribute></div>
<div class="ContentPasted1">                    <ref>ri:orgmanager</ref>  <!-- employeeNumber --></div>
<div class="ContentPasted1">                    <inbound></div>
<div class="ContentPasted1">                        <target></div>
<div class="ContentPasted1">                            <path>$focus/employeeNumber</path></div>
<div class="ContentPasted1">                        </target></div>
<div class="ContentPasted1">                    </inbound></div>
<div class="ContentPasted1">                </attribute></div>
<div class="ContentPasted1">                <attribute></div>
<div class="ContentPasted1">                    <ref>ri:orgnum</ref> <!-- organization code --></div>
<div class="ContentPasted1">                    <inbound></div>
<div class="ContentPasted1">                        <expression></div>
<div class="ContentPasted1">                            <assignmentTargetSearch></div>
<div class="ContentPasted1">                                <targetType>c:OrgType</targetType></div>
<div class="ContentPasted1">                                <assignmentProperties></div>
<div class="ContentPasted1">                                    <relation>org:manager</relation></div>
<div class="ContentPasted1">                                    <subtype>csvorgmanager</subtype></div>
<div class="ContentPasted1">                                </assignmentProperties></div>
<div class="ContentPasted1">                                <filter></div>
<div class="ContentPasted1">                                    <q:equal></div>
<div class="ContentPasted1">                                        <q:path>identifier</q:path></div>
<div class="ContentPasted1">                                        <expression></div>
<div class="ContentPasted1">                                            <path>$input</path></div>
<div class="ContentPasted1">                                        </expression></div>
<div class="ContentPasted1">                                    </q:equal></div>
<div class="ContentPasted1">                                </filter></div>
<div class="ContentPasted1">                            </assignmentTargetSearch></div>
<div class="ContentPasted1">                        </expression></div>
<div class="ContentPasted1">                        <target></div>
<div class="ContentPasted1">                            <path>$focus/assignment</path></div>
<div class="ContentPasted1">                            <set></div>
<div class="ContentPasted1">                                <condition></div>
<div class="ContentPasted1">                                    <script></div>
<div class="ContentPasted1">                                        <code></div>
<div class="ContentPasted1">                                            return input.subtype.contains("csvorgmanager")</div>
<div class="ContentPasted1">                                        </code></div>
<div class="ContentPasted1">                                    </script></div>
<div class="ContentPasted1">                                </condition></div>
<div class="ContentPasted1">                            </set></div>
<div class="ContentPasted1">                        </target></div>
<div class="ContentPasted1">                    </inbound></div>
<div class="ContentPasted1">                </attribute></div>
<div class="ContentPasted1">            </objectType></div>
        </schemaHandling><br class="ContentPasted0">
</div>
<br>
</div>
<div id="Signature">
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="margin-top:20px">Thanks<br>
</div>
<div style="margin-top:20px"><img alt="Serpro" style="float:left; margin-top:0%; margin-right:11px" width="156" height="88" src="https://servicos.serpro.gov.br/assets/img/assinatura_email_nova_serpro.png">
<div style="float:left; color:#8f9190; font-size:12px; font-family:Arial,sans-serif; border-left:1px solid #d1d5d8; padding-left:11px; min-height:72px">
<div style="color:#494a4c"><strong>Ruy Minoru Ito Takata</strong></div>
<div style="margin:5px 0"></div>
<div style="margin:5px 0">Analista</div>
<div style="margin:5px 0">Superintendência de Segurança da Informação</div>
<div style="margin:5px 0">Diretoria de Operações</div>
<div>+55 (11) 2173-1799</div>
<div></div>
</div>
</div>
<span style="clear:left"></span><br>
</div>
</div>
</div>
</div>
<span id="LGPD"><br>
<br>
“Essa mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada exclusivamente ao destinatário informado e pode conter dados pessoais, protegidos pela Lei Geral de Proteção
 de Dados (Lei 13.709/2018), assim como informações confidenciais, protegidas por sigilo profissional. O SERPRO ressalta seu comprometimento em assegurar a segurança e a proteção das informações contidas neste e-mail e informa que a sua utilização desautorizada
 é ilegal e sujeita o infrator às penas da lei. Se você o recebeu indevidamente, queira, por gentileza, reenviá-lo ao emitente, esclarecendo o equívoco.” “This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) - a government company established
 under Brazilian law (5.615/70) - is directed exclusively to its addressee and may contain personal data protected by the General Data Protection Law (13.709/2018) as well as confidencial data, protected under professional secrecy rules. SERPRO highlights its
 commitment to ensuring the security and protection of the information contained in this email and its unauthorized use is illegal and may subject the transgressor to the law´s penalties. If you´re not the addressee, please send it back, elucidating the failure.”
</span>
</body>
</html>