Microflow as a Data Source getting called twice where only once is expected

0
Hi,   I am using microflow as DataSource to set Boolean attributes to TRUE/FALSE if the logged in user belongs to Particular role. But the microflow is getting called twice where in I’m receiving the below error. Additionally, one observation from my end is that – For the second time, The Object is empty and so the change object for boolean values is giving error But I don’t understand why it’s calling the flow twice. There is no refresh happening while commit of the object. Error –  com.mendix.webui.WebUIException: Exception while retrieving data for 'MyFirstModule.ReviewerUI.dataView2' on document 'MyFirstModule.ReviewerUI'     at com.mendix.webui.actions.client.RetrieveAction.$anonfun$apply$3(RetrieveAction.scala:99) Caused by: com.mendix.modules.microflowengine.MicroflowException: Change object 'Some(ExtendedOrders)' should not be null     at MyFirstModule.ReviewerUI_PendingCases (Change : 'Change 'ExtendedOrders' (ShowRBAMButton, ShowWWBAMButton)') Advanced stacktrace:     at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:83) Caused by: java.lang.IllegalArgumentException: Change object 'Some(ExtendedOrders)' should not be null     at com.mendix.modules.microflowengine.actions.mxobject.ChangeAction.execute(ChangeAction.scala:43)     at com.mendix.modules.microflowengine.actions.mxobject.ChangeAction.execute(ChangeAction.scala:12)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32)     at scala.Option.flatMap(Option.scala:283)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAfterBreakingIfNecessary$2(MicroflowImpl.scala:167)     at scala.Option.flatMap(Option.scala:283)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:167)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:114)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25)     at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:80)     at com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19)     at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:79)     at com.mendix.basis.actionmanagement.MicroflowCallBuilderImpl.execute(MicroflowCallBuilderImpl.scala:38)     at com.mendix.webui.actions.client.RetrieveAction.retrieveAllByMicroflow(RetrieveAction.scala:120)     at com.mendix.webui.actions.client.RetrieveAction.$anonfun$apply$3(RetrieveAction.scala:59)     at scala.util.Either.map(Either.scala:382)     at com.mendix.webui.actions.client.RetrieveAction.apply(RetrieveAction.scala:43)     at com.mendix.webui.actions.client.RetrieveAction.apply(RetrieveAction.scala:28)     at com.mendix.webui.actions.client.RegularClientAction$Helpers$.$anonfun$liftEither$1(RegularClientAction.scala:30)     at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.$anonfun$apply$4(RegularClientAction.scala:56)     at com.mendix.webui.requesthandling.helpers.StateHandling.withState(StateHandling.scala:42)     at com.mendix.webui.requesthandling.helpers.StateHandling.withState$(StateHandling.scala:39)     at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.withState(RegularClientAction.scala:46)     at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.apply(RegularClientAction.scala:54)     at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.apply(RegularClientAction.scala:46)     at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$3(RegularClientAction.scala:113)     at scala.util.Try$.apply(Try.scala:210)     at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2(RegularClientAction.scala:113)     at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2$adapted(RegularClientAction.scala:111)     at com.mendix.webui.requesthandling.helpers.ContextHandling.$anonfun$inContext$5(ContextHandling.scala:57)     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)     at com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:49)     at com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19)     at com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:49)     at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:57)     at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:31)
asked
2 answers
0

One thing to add to your datasource microflow is a check for an empty object before trying to make any changes.

As for it being called twice… can you share your page and full microflow for us to help track down the issue?

answered
0

Hi Robert,

Please find the page and microflow here.

 

 

answered