<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Samu,<br>
<br>
although I'm not assigning resource account but a role instead, this
is my working code:<br>
<br>
<mapping><br>
<name>My Object Template: Assign Role XYZ</name><br>
<authoritative>true</authoritative><br>
<source><br>
<path>$user/employeeType</path><br>
</source><br>
<expression><br>
<assignmentTargetSearch><br>
<targetType>c:RoleType</targetType><br>
<oid>00000000-dc00-dc00-0004-000000000077</oid><br>
</assignmentTargetSearch><br>
</expression><br>
<target><br>
<path>assignment</path><br>
</target><br>
<condition><br>
<script><br>
<code>employeeType ==
'employee'</code><br>
</script> <br>
</condition><br>
</mapping><br>
<br>
Could you please the construction from the above - for your case
probably you need to change c:RoleType to c:ResourceType...<br>
<br>
Some other questions:<br>
1) are other mappings from the same object template working? (To
avoid problem of not using template at all...)<br>
2) how is the attribute organization set in your scenario?<br>
<br>
Best regards,<br>
Ivan<br>
<br>
<div class="moz-cite-prefix">On 11/24/2015 04:06 PM, Samu Viitanen
wrote:<br>
</div>
<blockquote cite="mid:DUB117-W10578FA5434E5A9AA301A92D1060@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">Hello,<br>
<br>
I am having trouble finding a solution on how to create
conditional assignments in an Object Template. I have an Object
Template and I would like to see if the Focus user's attribute
"organization" matches to a specific string before creating my
assignment. See mapping below<br>
<br>
<mapping><br>
<source><br>
<c:path>organization</c:path><br>
</source><br>
<expression><br>
<value><br>
<targetRef oid="resource-oid-123-456"
type="c:ResourceType"/><br>
</value><br>
</expression><br>
<target><br>
<c:path>assignment</c:path><br>
</target><br>
<condition><br>
<script><br>
<description><br>
Create a condition to see that the organization
matches<br>
</description><br>
<code>organization == 'org'</code><br>
</script><br>
</condition><br>
</mapping><br>
<br>
This is the point where I am stuck. I figured that the example
above is somewhat correct, but the condition is still never true
even though I know my focus user's organization is 'org'. I am
not very familiar with expressions and conditions yet. I tried
to find the answer in Wiki, but didn't find a related example. I
also looked into the live demo's Object Template, where a
similar thing is done, but it did not help me here.<br>
<br>
Best Regards<br>
Samu Viitanen<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Ing. Ivan Noris
Senior Identity Management Engineer & IDM Architect
evolveum.com evolveum.com/blog/
___________________________________________________
"Semper Id(e)M Vix."
</pre>
</body>
</html>