CommunityCommons.executeMicroflowInBackground imported objects are not retrieved.

0
Hello everyone,  I am working on a Mendix app where i upload an ExcelFile(e.g 50k lines), perform validation checks. I have an issue with CommunityCommons.executeMicroflowInBackground  java action. Why is my retrive action is empty after java action? Within the java action everthing  works as expected.But i would like to do some actions outdie of the java action. I tried some solution which worked but not really helping me.  1- if i set a delay action lets say 5 seconds, then the retrive works. 2- See the picture: or If i try to check the object until it is retrieved then it works.. So i would like to know if there are other solutions. Thanks in advance.  
asked
3 answers
1

Hi Selcuk,

Did you try using the end transaction and start transaction java actions?

Maybe you can place the end transaction just after the Java action and then just after the end transaction you can use the start transaction java action.

Then try retrieving the list, that you want to perform your operation on.

 

Let me know, if you have any issue,

Hope it helps!

 

Rishabh

(Resilientitservices)

answered
0

Probably the microflow you trigger in the Java action isn't finished the moment you do your retrieve. 

Can't you replace the java action with a sub microflow?! Then you'll be sure the data is available when it goes to the next step.

answered
0

Hi Selcuk,

 

the "Executemicroflowinbackground" should not be used if the result of the microflow call is  needed to perform additional checks or actions.

 

It is an asynchronous operation, in the calling microflow you have no way of knowing when the background action starts and when it is finished. For example, if another action is already running in the background, that one needs to be completed first.

 

Use a normal microflow call, or show a page with the target objects in a datagrid and use the microflow timer or other automatic refresh option to see the progress of the background task.

answered