<html><body>Hi All,<div><br></div><div>need help with importing date times in MidPoint from CSV.</div><div><br></div><div>In CSV th<span style="background-color:transparent">ere is date time in format: </span><span style="background-color:transparent;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"> </span><span style="background-color:transparent;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px">"12/31/2000 11:00:00 AM"</span><span style="background-color:transparent;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"> </span></div><div><span style="color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;background-color:transparent"><br></span></div><div>In resource i have enabled activation capability and I tryed to map value as showwn in config bellow:<span style="color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;background-color:transparent"><br></span></div><div><br></div><div><div>         <attribute id="12"></div><div>            <c:ref>ri:StartDate</c:ref></div><div>            <tolerant>true</tolerant></div><div>            <exclusiveStrong>false</exclusiveStrong></div><div>            <inbound id="17"></div><div>               <authoritative>true</authoritative></div><div>               <exclusive>false</exclusive></div><div>               <strength>normal</strength></div><div>               <expression></div><div>                  <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div><div>                          xsi:type="c:ScriptExpressionEvaluatorType"></div><div>                     <code></div><div>       import java.text.SimpleDateFormat;</div><div>       import java.text.DateFormat;</div><div><br></div><div>       DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss a");</div><div><br></div><div>       if (input!=null) {</div><div>           Date convertedValidFrom = df.parse(input);</div><div>     log.info ("convertedValidFrom = " +</div><div>     convertedValidFrom);</div><div><br></div><div>           return</div><div>     com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar(convertedValidFrom);</div><div>       }</div><div>       else {</div><div>           return null;</div><div>       }</div><div><br></div><div>                                 </code></div><div>                  </script></div><div>               </expression></div><div>               <target></div><div>                  <c:path>$focus/activation/validFrom</c:path></div><div>               </target></div><div>            </inbound></div><div>         </attribute></div></div><div><br></div><div><span style="color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;background-color:transparent">But it doesnt work to me. I am getting error messages like here:</span></div><div><br></div><div><div style="box-sizing:border-box;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"><table style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;background-color:transparent;width:1622px;max-width:100%;margin-bottom:20px;padding-top:0px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td style="box-sizing:border-box;padding:5px;line-height:1.42857;vertical-align:top;border-top:1px solid rgb(244,244,244);max-width:250px;word-wrap:break-word"><div style="box-sizing:border-box">1001: java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM" in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)({.../common/common-3}input=12/31/2000 11:00:00 AM; ) in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)<br style="box-sizing:border-box"></div></td></tr></tbody></table><dt style="box-sizing:border-box;line-height:1.42857;font-weight:700;float:left;width:100px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap">Operation</dt><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;word-break:break-word"><span style="box-sizing:border-box;font-weight:700">Save (GUI)</span></dd><dt style="box-sizing:border-box;line-height:1.42857;font-weight:700;float:left;width:100px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap">Message</dt><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;word-break:break-word">java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM" in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)({.../common/common-3}input=12/31/2000 11:00:00 AM; ) in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)</dd><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;word-break:break-word"><table style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;background-color:transparent;border:0px"></table></dd><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;word-break:break-word"><table style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;background-color:transparent;border:0px"></table></dd><dt style="box-sizing:border-box;line-height:1.42857;font-weight:700;float:left;width:100px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap">Error</dt><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;word-break:break-word">java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM" in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)({.../common/common-3}input=12/31/2000 11:00:00 AM; ) in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)</dd><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;word-break:break-word"><a style="box-sizing:border-box;background-color:transparent;color:rgb(60,141,188);text-decoration-line:none">show</a></dd><dd style="box-sizing:border-box;line-height:1.42857;margin-left:130px;font-family:monospace;white-space:pre-wrap;font-size:11px;word-break:break-word">com.evolveum.midpoint.util.exception.ExpressionEvaluationException: java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM" in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)({.../common/common-3}input=12/31/2000 11:00:00 AM; ) in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)
        at com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.lambda$evaluateRelativeExpression$0(AbstractValueTransformationExpressionEvaluator.java:433)
        at com.evolveum.midpoint.util.MiscUtil.carthesian(MiscUtil.java:370)
        at com.evolveum.midpoint.util.MiscUtil.carthesian(MiscUtil.java:360)
        at com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluateRelativeExpression(AbstractValueTransformationExpressionEvaluator.java:457)
        at com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluate(AbstractValueTransformationExpressionEvaluator.java:118)
        at com.evolveum.midpoint.repo.common.expression.Expression.evaluateExpressionEvaluators(Expression.java:213)
        at com.evolveum.midpoint.repo.common.expression.Expression.evaluate(Expression.java:149)
        at com.evolveum.midpoint.model.common.mapping.Mapping.evaluateExpression(Mapping.java:1055)
        at com.evolveum.midpoint.model.common.mapping.Mapping.evaluateBody(Mapping.java:446)
        at com.evolveum.midpoint.model.common.mapping.Mapping.evaluate(Mapping.java:372)
        at com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluator.evaluateMapping(MappingEvaluator.java:140)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.InboundProcessor.evaluateInboundMapping(InboundProcessor.java:836)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.InboundProcessor.processInboundMappingsForProjection(InboundProcessor.java:293)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.InboundProcessor.processInboundFocal(InboundProcessor.java:223)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.InboundProcessor.processInbound(InboundProcessor.java:165)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.FocusProcessor.lambda$processFocusFocus$0(FocusProcessor.java:210)
        at com.evolveum.midpoint.model.impl.lens.LensUtil.partialExecute(LensUtil.java:947)
        at com.evolveum.midpoint.model.impl.lens.LensUtil.partialExecute(LensUtil.java:934)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.FocusProcessor.processFocusFocus(FocusProcessor.java:207)
        at com.evolveum.midpoint.model.impl.lens.projector.focus.FocusProcessor.processFocus(FocusProcessor.java:140)
        at com.evolveum.midpoint.model.impl.lens.projector.Projector.lambda$projectInternal$1(Projector.java:229)
        at com.evolveum.midpoint.model.impl.lens.LensUtil.partialExecute(LensUtil.java:947)
        at com.evolveum.midpoint.model.impl.lens.projector.Projector.projectInternal(Projector.java:227)
        at com.evolveum.midpoint.model.impl.lens.projector.Projector.project(Projector.java:116)
        at com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:445)
        at com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:202)
        at com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:538)
        at com.evolveum.midpoint.web.component.progress.ProgressPanel$14.callWithContextPrepared(ProgressPanel.java:605)
        at com.evolveum.midpoint.web.component.progress.ProgressPanel$14.callWithContextPrepared(ProgressPanel.java:591)
        at com.evolveum.midpoint.web.component.SecurityContextAwareCallable.call(SecurityContextAwareCallable.java:59)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.evolveum.midpoint.util.exception.ExpressionEvaluationException: java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM" in expression in mapping in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}StartDate in resource:900dd939-02da-48f2-a7b9-683de6b8d486(HR Feed)
        at com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:120)
        at com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:107)
        at com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:63)
        at com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.lambda$evaluateRelativeExpression$0(AbstractValueTransformationExpressionEvaluator.java:425)
        ... 33 more
Caused by: javax.script.ScriptException: java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM"
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:347)
        at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)
        at javax.script.CompiledScript.eval(Unknown Source)
        at com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:116)
        ... 36 more
Caused by: java.text.ParseException: Unparseable date: "12/31/2000 11:00:00 AM"
        at java.text.DateFormat.parse(Unknown Source)
        at java_text_DateFormat$parse.call(Unknown Source)
        at Script41.run(Script41.groovy:8)
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:344)
        ... 39 more</dd></div><div style="box-sizing:border-box;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"><br></div><div style="box-sizing:border-box;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px">Can someone help me with that?</div><div style="box-sizing:border-box;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"><br></div><div style="box-sizing:border-box;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px">Thanks Jan</div><p style="box-sizing:border-box;margin-bottom:10px;color:rgb(51,51,51);font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"></p><a href="http://192.168.2.102:8080/admin/task2/03b67e2f-4b00-420e-a13e-fa897e93586d?635-1.ILinkListener-mainPanel-mainForm-tabPanel-panel-showResult" style="box-sizing:border-box;color:rgb(60,141,188);text-decoration-line:none;font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px"></a></div></body></html>