<div dir="ltr">1. Its the database connector<div>2. switch connector</div><div>3. same issue<br><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br></div><div>Switching your resource as it is is not to difficult to scriptedsql, you just need to edit the resource xml file and then provide the groovy scripts, i attached one of our database view scripts, the multivalue role field is memberOf which in the view is seperated by a semicolon ; and is constructed using STUFF in sql. I removed many of the column names and trimmed down the sql script but you can get the idea of how easy it is to move the scriptedsql. The update script is the same except you use standard UPDATE/DELETE sql statements.</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019 at 1:05 PM Justin Stanczak <<a href="mailto:rizenine@gmail.com">rizenine@gmail.com</a>> wrote:<br></div><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"><div dir="ltr"><div dir="ltr"><div dir="ltr">So from what you've told me, I tried something. This code with a condition on the target like so:<div><br></div><div><div><i><target></i></div><div><i><c:path>assignment</c:path></i></div><div><i><set></i></div><div><i>    <condition></i></div><div><i>        <script xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:type="c:ScriptExpressionEvaluatorType"></i></div><div><i>            <code></i></div><div><i>               <a href="http://log.info" target="_blank">log.info</a>("####### assignment: " + assignment)</i></div><div><i>               return false</i></div><div><i><span style="white-space:pre-wrap">  </span>   </code></i></div><div><i>        </script></i></div><div><i>    </condition></i></div><div><i></set></i></div><div><i></target></i></div></div><div><br></div><div>Adds the role and keeps all the old assignments. Clearly, this is simple and like you all have said not the midpoint way as I do have multiple rows per user and role. This resource is only inbound at this time.</div><div><br></div><div>I'm definitely for doing this the correct way. With that in mind I have a few more questions:</div><div><ol><li>Is using the database connector an issue or presenting the data correctly the issue?</li><li>The table structure suggested, should I use associations instead of attributes?<br></li><li>Would changing to entitlements help? I would still have the one-to-many issue, right?</li></ol></div><div>My ultimate goal is to have roles added and removed from midpoint according to the table updates. This would trigger resource changes via inducements on said roles.</div><div><br></div><div>Thanks.</div><div><br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019 at 1:13 PM Jason Everling <<a href="mailto:jeverling@bshp.edu" target="_blank">jeverling@bshp.edu</a>> wrote:<br></div><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"><div dir="ltr">Alcides is correct, its why I asked earlier on if they were going to have multiple roles, which is one of the limitations of the database table connector. If you plan to have outbound updates then you would need to switch to a scriptedsql connector because it can use a database view as the source data that you will need to manipulate to create a multivalue field for your roles, probably using STUFF in sql, and then when updates occur/needed it can write to any database, table and column on your server.</div><div dir="ltr"><br></div><div>On to your sample, because you don't have a condition it is telling midpoint that the persons 'assignment' value should only should be this value, in an object template it will append values if you have it set that way. You would need to use a condition as in evolveums sample, the easiest way is to identify your roles using the roletype/subtype field.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2019 at 11:30 AM Alcides Carlos de Moraes Neto <<a href="mailto:alcides.neto@gmail.com" target="_blank">alcides.neto@gmail.com</a>> wrote:<br></div><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"><div dir="ltr"><div>If I'm understanding correctly, you want to create a resource with multiple projections, and each projection would result in a roleAssignment.</div><div><br></div><div>Unfortunately that's not how resources in midPoint work. You can have multiple projections of the same objectType but only with multiple intents.</div><div><a href="https://wiki.evolveum.com/display/midPoint/Focus+and+Projections" target="_blank">https://wiki.evolveum.com/display/midPoint/Focus+and+Projections</a></div><div>If you try to import multiple projections to the same focus object, only one will be linked, the other will stay unlinked (i guess? maybe unmatched?)</div><div><br></div><div>You should struct your table/view like this:</div><div><br></div><div>USER  ROLES  LASTUPDATE</div><div>test    student,employee    datetime</div><div>test2  student                     datetime</div><div><br></div><div>There should be only one line per user. Then you would need to write a script to interpret the ROLES column, splitting it and searching for the roles.</div></div></div></blockquote></div>
</blockquote></div></div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div>