Error on formatDate($DateRange/Date) in Microflow of Questionnaire module

0
com.mendix.modules.microflowengine.MicroflowException: com.mendix.modules.microflowengine.MicroflowException: Failed to evaluate expression, error occurred on line 5, character 1 if $DateRange = empty then '' else formatDate($DateRange/Date) ^ at Questionnaire.GetAnswer (End : '') at Questionnaire.DownloadXMLFile (ImportXML : 'Export XML document (NewXMLFile)') at Questionnaire.DownloadRevisionResult (SubMicroflow : 'DownloadXMLFile') Advanced stacktrace: at Questionnaire.DownloadXMLFile (ImportXML : 'Export XML document (NewXMLFile)') at Questionnaire.DownloadRevisionResult (SubMicroflow : 'DownloadXMLFile') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(SourceFile:158) Caused by: com.mendix.core.CoreException: com.mendix.modules.microflowengine.MicroflowException: Failed to evaluate expression, error occurred on line 5, character 1 if $DateRange = empty then '' else formatDate($DateRange/Date) ... Advanced stacktrace: at com.mendix.languages.mxexpressions.MxExpression.evaluate(SourceFile:20) Caused by: com.mendix.languages.expressions.ExpressionException: com.mendix.languages.expressions.ExpressionException: java.lang.NullPointerException at com.mendix.languages.expressions.Expr.evaluate(SourceFile:34) Caused by: com.mendix.languages.expressions.ExpressionException: java.lang.NullPointerException at com.mendix.languages.expressions.Expr.evaluate(SourceFile:38) Caused by: java.lang.NullPointerException: null at java.util.Calendar.setTime(Calendar.java:1106) at java.text.SimpleDateFormat.format(SimpleDateFormat.java:955) at java.text.SimpleDateFormat.format(SimpleDateFormat.java:948) at java.text.DateFormat.format(DateFormat.java:336) at com.mendix.languages.expressions.DateTimeFunctionCallEvaluator.evaluateFormatDate(SourceFile:89) at com.mendix.languages.expressions.FunctionCallExpr.evaluateExpression(SourceFile:120) at com.mendix.languages.expressions.Expr.evaluate(SourceFile:30) at com.mendix.languages.expressions.IfExpr.evaluateExpression(SourceFile:29) at com.mendix.languages.expressions.Expr.evaluate(SourceFile:30) at com.mendix.languages.mxexpressions.MxExpression.evaluate(SourceFile:16) at com.mendix.id.c(SourceFile:20) at com.mendix.id$a.apply$mcV$sp(SourceFile:24) at com.mendix.ih.a(SourceFile:35) at com.mendix.id.a(SourceFile:11) at com.mendix.id.b(SourceFile:24) at com.mendix.id.a(SourceFile:11) at com.mendix.ij.a(SourceFile:193) at com.mendix.ij.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:199) at com.mendix.core.component.InternalCore.execute(SourceFile:378) at com.mendix.gQ.a(SourceFile:349) at com.mendix.gQ.a(SourceFile:335) at com.mendix.gQ.a(SourceFile:256) at com.mendix.gQ.b(SourceFile:130) at com.mendix.gQ.a(SourceFile:117) at com.mendix.gQ.b(SourceFile:169) at com.mendix.gQ.a(SourceFile:152) at com.mendix.gQ.b(SourceFile:139) at com.mendix.gQ.a(SourceFile:117) at com.mendix.gQ.b(SourceFile:169) at com.mendix.gQ.a(SourceFile:152) at com.mendix.gQ.b(SourceFile:139) at com.mendix.gQ.a(SourceFile:72) at com.mendix.fX.a(SourceFile:77) at com.mendix.fX.a(SourceFile:64) at com.mendix.fX.a(SourceFile:38) at com.mendix.fX.execute(SourceFile:21) at com.mendix.ik.a(SourceFile:47) at com.mendix.ij.a(SourceFile:193) at com.mendix.ij.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:199) at com.mendix.core.component.InternalCore.executeSync(SourceFile:235) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SourceFile:33) at com.mendix.ik.a(SourceFile:47) at com.mendix.ij.a(SourceFile:193) at com.mendix.ij.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:199) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.iW.a(SourceFile:135) at com.mendix.pj$g.apply$mcV$sp(SourceFile:294) at com.mendix.pj$g.apply(SourceFile:285) at com.mendix.pj$g.apply(SourceFile:285) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(SourceFile:158) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(SourceFile:36) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(SourceFile:160) at scala.util.Try$.apply(Try.scala:191) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(SourceFile:154) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(SourceFile:147) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
asked
1 answers
0

Yvonne,

Most of the time with these kind of errors you can pinpoint it to the microflow that is throwing the error. Nullpointers are almost always mistakes made by the programmer. Set a breakpoint and check all the parameters of the expression. For instance, you do check if $DataRange = empty, but you do not check if $DateRange/Date is empty. So check at the breakpoint that you indeed got a $DateRange/Date.

Regards,

Ronald

answered