[midPoint] Parsing Dates in Inbound Mapping

Pavol Mederly mederly at evolveum.com
Tue Aug 23 19:14:17 CEST 2016


Hello Matt,

I assume you get something like "unknown variable 'birthdate'" 
exception. When creating inbound mappings, you refer to the incoming 
value (from the resource) via "input" variable.

So your line should be something like Date.parse(..., input).

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 23.08.2016 19:10, Mencel, Matt wrote:
> 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
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160823/10abea99/attachment.htm>


More information about the midPoint mailing list