<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      I have similar mapping working in our story tests.<br>
      <br>
      How does your input object looks like? I mean, how does the user
      looks like before it is processed by the template?<br>
      Is there any chance that the givenName is null?<br>
      <br>
      The evaluation of null expressions has changed a bit in 3.3. But I
      think that your expression should work and you are probably
      hitting a but. I will need more data to replicate it.<br>
      <br>
      <pre class="moz-signature" cols="72">-- 
Radovan Semancik
Software Architect
evolveum.com
</pre>
      <br>
      <br>
      On 12/04/2015 05:15 PM, Devin Rosenbauer wrote:<br>
    </div>
    <blockquote
cite="mid:CABiXpeRg3TRTqsdPXQwH7v4iowhSG4r3pYhv+O2Ox9f8H_i+zg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Can anybody else please try this mapping on their
        end and see if it works?<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Dec 1, 2015 at 1:51 PM, Devin
          Rosenbauer <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:devin@identityworksllc.com" target="_blank">devin@identityworksllc.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Version is 3.3.<br>
              <div><br>
                I've got the following in my user template, based on a
                somewhat modified version of what's in the documentation
                online:<br>
                <br>
                  <mapping><br>
                      <source><br>
                         <c:path>$user/givenName</c:path><br>
                      </source><br>
                      <expression><br>
                         <assignmentTargetSearch><br>
                           
                <targetType>c:OrgType</targetType><br>
                            <filter><br>
                               <q:equal><br>
                                  <q:path>c:name</q:path><br>
                                  <q:value><br>
                                     <expression><br>
                                       
                <path>$givenName</path><br>
                                     </expression><br>
                                  </q:value><br>
                               </q:equal><br>
                            </filter><br>
                           
                <createOnDemand>true</createOnDemand><br>
                            <populateObject><br>
                               <populateItem><br>
                                  <expression><br>
                                    
                <c:path>$givenName</c:path><br>
                                  </expression><br>
                                  <target><br>
                                     <c:path>name</c:path><br>
                                  </target><br>
                               </populateItem><br>
                            </populateObject><br>
                         </assignmentTargetSearch><br>
                      </expression><br>
                      <target><br>
                         <c:path>assignment</c:path><br>
                      </target><br>
                   </mapping><br clear="all">
                <div><br>
                </div>
                <div>I expect that this would create an Org called
                  "Devin" and assign the user to it.<br>
                  <br>
                </div>
                <div>Here's what I get as an error message when I
                  attempt to save and reconcile the user:<br>
                  <div style="width:1121px">
                    <ul>
                      <li>
                        <div>
                          <div title="Partial error">Failed to convert
                            query. Reason: Null polystring orig in
                            XNode(map:1
                            entries)(givenName=PPV(PolyString:Devin); )
                            in expression in mapping in
                            objectTemplate:c0c010c0-d34d-b33f-f00d-777222222334(User
                            Template 2)</div>
                          <div title="Partial error">
                            <ul>
                              <li style="margin-top:5px">
                                <div> <span>operation.com.evolveum.midpoint.web.page.admin.PageAdminFocus.save</span>
                                </div>
                              </li>
                              <li> <span> <u>Cause:</u> <span>
                                    <p>Failed to convert query. Reason:
                                      Null polystring orig in
                                      XNode(map:1
                                      entries)(givenName=PPV(PolyString:Devin);
                                      ) in expression in mapping in
                                      objectTemplate:c0c010c0-d34d-b33f-f00d-777222222334(User
                                      Template 2)</p>
                                  </span> </span> </li>
                            </ul>
                          </div>
                        </div>
                      </li>
                    </ul>
                  </div>
                  The documentation on the Expressions page and the
                  samples appear to be somewhat incorrect here. I've had
                  to make some corrections from <query> to
                  <filter>, adding a <source>, and so forth.
                  I also am temporarily using an OOTB field instead of a
                  custom field to ensure that it's a PolyString and not
                  an xsd:string, just to make sure that wasn't the
                  issue.<br>
                  <br>
                  At this point, it seems pretty clear that it is
                  grabbing the value in the XNodeMap, since it's printed
                  in the error message. <br>
                  <br>
                  So, how should this mapping be structured to do what I
                  need to do?<span class="HOEnZb"><font color="#888888"><br>
                    </font></span></div>
                <span class="HOEnZb"><font color="#888888">
                    <div><br>
                      -- <br>
                      <div>
                        <div dir="ltr">Devin Rosenbauer<br>
                          Principal Consultant<br>
                          Identity Works LLC<br>
                          <a moz-do-not-send="true"
                            href="tel:%2B1%20585%20210%203201"
                            value="+15852103201" target="_blank">+1 585
                            210 3201</a><br>
                        </div>
                      </div>
                    </div>
                  </font></span></div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr">Devin Rosenbauer<br>
            Principal Consultant<br>
            Identity Works LLC<br>
            +1 585 210 3201<br>
          </div>
        </div>
      </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>
    <br>
  </body>
</html>