[midPoint] Parsing Dates in Inbound Mapping
    Mencel, Matt 
    mr-mencel at wiu.edu
       
    Tue Aug 23 19:10:24 CEST 2016
    
    
  
So in my CSV I have a birthday field stored as a string value like so...
'20160822'.  I've created a DOB field in my custom schema of type date...
            <xsd:element name="birthDate" type="xsd:date" minOccurs="0"
maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:indexed>false</a:indexed>
                        <a:displayName>DOB</a:displayName>
                        <a:displayOrder>130</a:displayOrder>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
and am trying to parse the string to the date field using the following in
my mapping...which doesn't work at the moment.
<attribute>
<ref>ri:birthdate</ref>
<displayName>DOB</displayName>
<inbound>
<target>
<path>$user/extension/birthDate</path>
</target>
<expression>
           <script>
               <language>
http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy
</language>
               <code>
                   Date.parse('yyyymmdd', birthdate)
               </code>
           </script>
       </expression>
</inbound>
</attribute>
Do I need to do the script in the user object template instead?
Thanks,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160823/18be5721/attachment.htm>
    
    
More information about the midPoint
mailing list