<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000"><br>
<span><br>
Hi Ivan -<br>
<br>
Thanks - I tried with $c:input and it worked.<br>
<br>
It's a bit weird since in an object template (which I use for 
post-creation assignments etc),  doing it like this worked :<br>
  <br>
</span><mapping><br>
    <source><br>
        <name>varname</name><br>
        <path>varpath</path><br>
    </source><br>
    <expression><br>
        <script><br>
            <code><br>
                    tokenize(varname...)<br>
            </code><br>
        </script><br>
    </expression><br>
<br>
seems to work, but this fails when I try something similar in a resource
 configuration...thought it is quite possible my varpath had an error in
 it...(i used $account/attributes/ri:var)<br>
<br>
but using 'input' works, thanks!<br>
<blockquote style="border: 0px none;" 
cite="mid:52C571B4.9080201@evolveum.com" type="cite">
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="display:table;width:100%;border-top:1px solid 
#EDEEF0;padding-top:5px">       <div 
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
 photoaddress="ivan.noris@evolveum.com" photoname="Ivan Noris" 
src="cid:part1.00090602.08020002@trilobytesystems.com" 
name="compose-unknown-contact.jpg" height="25px" width="25px"></div>   <div
 
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" href="mailto:ivan.noris@evolveum.com" 
style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Ivan Noris</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">January 2, 2014 
at 4:03 PM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
    Hi Deepak,<br>
    <br>
    just a blind shot - try to use implicit variable named "input" (it
    is mapped to the "source" of the inbound expression, in your case,
    ri:orgdesc).<br>
    <br>
    See an example (adapted from my customer's resource) written in
    Groovy (not XPath):<br>
    <br>
    <attribute><br>
        <ref>ri:orgUnitHierarchy</ref><br>
        <displayName>Organizational Hierarchy</displayName><br>
        <access>read</access><br>
        <inbound><br>
        <expression><br>
            <script><br>
                <code><br>
    String[] tmpHierarchyList = <b>input</b> ? <b>input</b>?.split('\\.')

    : []<br>
    tmpHierarchyListNew = []<br>
    <br>
    <!-- some processing skipped here . . . --><br>
    <br>
    return tmpHierarchyListNew.join(':')<br>
    </code><br>
            </script><br>
        </expression><br>
          <target><br>
        <path>$user/extension/mycustomer:ouPath</path><br>
          </target><br>
        </inbound><br>
    </attribute><br>
    <br>
    I do not use XPath in expressions unless absolutely necessary
    because the debugging is quite _challenging_ ;) and it's lot easier
    to debug Groovy statements.<br>
    <br>
    Regards,<br>
    Ivan<br>
    <br>
    <div class="moz-cite-prefix">On 01/02/2014 02:50 PM, Deepak
      Natarajan wrote:<br>
    </div>
    
    <br>
    <div>-- <br>  Ing. Ivan Noris<br>  Consultant<br>  Evolveum, s.r.o<br>
  ___________________________________________________<br>  "Semper 
cautus - semper paratus - semper idem Vix."<br></div>
  <div>_______________________________________________<br>midPoint 
mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br><a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br></div></div>
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="display:table;width:100%;border-top:1px solid 
#EDEEF0;padding-top:5px">       <div 
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
 photoaddress="dnataraj@trilobytesystems.com" photoname="Deepak 
Natarajan" src="cid:part1.00090602.08020002@trilobytesystems.com" 
name="compose-unknown-contact.jpg" height="25px" width="25px"></div>   <div
 
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" 
href="mailto:dnataraj@trilobytesystems.com" style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Deepak Natarajan</a></div>   <div 
style="display:table-cell;white-space:nowrap;vertical-align:middle;">   
  <font color="#9FA2A5"><span style="padding-left:6px">January 2, 2014 
at 3:50 PM</span></font></div></div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
  <br>
Hi -<br>
  <br>
I'm struggling with a simple evaluation (I've removed namespace 
declarations for readability) :<br>
  <br>
                <attribute><br>
                    <ref><span style="font-weight: bold;">ri:orgdesc</span></ref><br>
                    <inbound><br>
                        <expression><br>
                            <script><br>
                                
<language><a moz-do-not-send="true" 
href="http://www.w3.org/TR/xpath/" class="moz-txt-link-freetext">http://www.w3.org/TR/xpath/</a></language><br>
                                <code ...><br>
                                    
tokenize($account/attributes/ri:orgdesc,"/")[last()]<br>
                                </code><br>
                            </script><br>
                        </expression><br>
                        <target><br>
                            
<path>$user/extension/apos:aposUnitAttributes</path><br>
                        </target><br>
                    </inbound><br>
                </attribute><br>
  <br>
I've tried everything, but the variable passed to the XPath tokenize 
function is always nil (I know the function works correctly, since I use
 it elsewhere, and using a literal string above produces the correct 
results)<br>
  <br>
I've tried including a <source> before the expression with an 
explicit <name> but that doesn't seem to work either.<br>
  <br>
Thanks for any input! - I'm using build <span><meta content="text/html; 
charset=UTF-8" http-equiv="content-type">Version:
 2.3-SNAPSHOT, describe: git-v2.3devel-383-g6ef8f72 </span><br>
  <br>
BR/Deepak<br>
  <br>
  </div>
</blockquote>
</body></html>