<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thanks. Documentation is fixed.<br>
      <br>
      On 12/07/2015 05:31 PM, Devin Rosenbauer wrote:<br>
    </div>
    <blockquote
cite="mid:CABiXpeSypCVLma_Xpis1zrG8gJBJCHecCd_2u3M4PeP_QxOA+A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Perfect! That appears to work!<br>
          <br>
          I found it in various places:<br>
          <br>
        </div>
        The expression explained here simply doesn't work in 3.3. I had
        to modify quite a few things:<br>
        <div><a moz-do-not-send="true"
href="https://wiki.evolveum.com/display/midPoint/Expression#Expression-AssignmentTargetSearch">https://wiki.evolveum.com/display/midPoint/Expression#Expression-AssignmentTargetSearch</a><br>
          <br>
        </div>
        <div>The search filter layout I used was here:<br>
          <a moz-do-not-send="true"
            href="https://wiki.evolveum.com/display/midPoint/XML+Object+Query">https://wiki.evolveum.com/display/midPoint/XML+Object+Query</a><br>
          <br>
        </div>
        <div>After reading those pages, I misread the sample at
          /samples/demo-generic synchronization/object-template-user.xml
          and missed that there was indeed no <q:value> tag in the
          sample. I had also poked around through the schema and
          observed that <value> was an allowed field at that
          location, so I figured that couldn't have been the problem.<br>
          <br>
        </div>
        <div>Thanks!<br>
        </div>
        <div><br>
          <br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Dec 7, 2015 at 11:20 AM,
          Radovan Semancik <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:radovan.semancik@evolveum.com"
              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:radovan.semancik@evolveum.com">radovan.semancik@evolveum.com</a></a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hi,<br>
                <br>
                I have extended our object template tests to make sure
                that this case works. And it really works. After
                extending the tests I have found the error in your
                definition.<br>
                <br>
                Instead of<span class=""><br>
                  <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>
                  <br>
                </span> use<span class=""><br>
                  <br>
                                 <q:equal><br>
                                    <q:path>c:name</q:path><br>
                </span><span class="">                  
                  <expression><br>
                                       
                  <path>$givenName</path><br>
                                    </expression><br>
                </span>                </q:equal><br>
                <br>
                <br>
                i.e. remove the <q:value> element. In your case
                midPoint interpreted the whole
                <expression>...</expression> as a literal
                value which caused strange things to happen ...<br>
                <br>
                BTW, could you point me to the documentation that you
                have used to create your code, please? It perhaps needs
                an update.<span class=""><br>
                  <br>
                  <pre cols="72">-- 
Radovan Semancik
Software Architect
<a moz-do-not-send="true" href="http://evolveum.com" target="_blank">evolveum.com</a>
</pre>
                  <br>
                  <br>
                </span>
                <div>
                  <div class="h5"> On 12/07/2015 04:05 PM, Devin
                    Rosenbauer wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>In this case, I'm actually not making any
                        changes to the input object. Given Name is
                        already set to the value that shows up in the
                        error message ("Devin"), and I'm just hitting
                        Save with the Reconcile checkbox checked.<br>
                        <br>
                      </div>
                      However, this also happens if I change the name to
                      something else. In both cases, it's not null.<br>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Mon, Dec 7, 2015 at
                        10:02 AM, Radovan Semancik <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:radovan.semancik@evolveum.com"
                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:radovan.semancik@evolveum.com">radovan.semancik@evolveum.com</a></a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000">
                            <div>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 cols="72">-- 
Radovan Semancik
Software Architect
<a moz-do-not-send="true" href="http://evolveum.com" target="_blank">evolveum.com</a>
</pre>
                              <div>
                                <div> <br>
                                  <br>
                                  On 12/04/2015 05:15 PM, Devin
                                  Rosenbauer wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>
                                  <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"><a class="moz-txt-link-abbreviated" href="mailto:devin@identityworksllc.com">devin@identityworksllc.com</a></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><font
                                                  color="#888888"><br>
                                                </font></span></div>
                                            <span><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>
                                      <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>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
                            </blockquote>
                            <br>
                            <br>
                          </div>
                          <br>
_______________________________________________<br>
                          midPoint mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:midPoint@lists.evolveum.com"
                            target="_blank">midPoint@lists.evolveum.com</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.evolveum.com/mailman/listinfo/midpoint"
                            rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <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>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
                  </blockquote>
                  <br>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            midPoint mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
            <a moz-do-not-send="true"
              href="http://lists.evolveum.com/mailman/listinfo/midpoint"
              rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
            <br>
          </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>
    <pre class="moz-signature" cols="72">-- 
Radovan Semancik
Software Architect
evolveum.com
</pre>
  </body>
</html>