Adjusting Microflow Timeout to extend longer than 5000ms

0
One of the things that we have set up in our app currently is a custom Excel Export microflow that goes through all of the different entities in our app and exports the data into separate tabs in an Excel file. It’s consisted of about 25-30 sub-microflows that retrieve the data for the specified entity, and then place them into “Excel Entities” that are all connected to a SystemDoc entity so that they can all be saved to a file. Our app has a large volume of data, however for a bit this “mass export” microflow was working just fine. We tried it today, and ended up running into some errors, even though we haven’t done anything to the app really since that export got added. We checked the logs and saw the following message associated with different microflows: Caused by: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.util.concurrent.TimeoutException: The operation time exceeded 5000ms. I did some research and saw that there was a line of code that could be added to index.html to increase the timeout time past 5000ms, however I want to double check and see if there is any settings within Mendix Studio that I can change, or if there are any tried and true solutions that could be applied here. The app is currently registered as a free app on the developer portal as a bit more background information. Any ideas would be greatly appreciated. Thanks!
asked
2 answers
0

Assuming that you are running the MF from a button, open the properties and go to the mircoflow settings to change the microlfow call type from synchronous to Asynchronous. Then the timeout will no longer apply and there is no need for more complex settings. Some insights are found here: https://www.mendix.com/blog/take-a-time-out-to-learn-about-asynchronous-calling/

 

answered
0

In response to your comment, it is possible to run sub microflows asynchronous with the help of the community commons module (https://docs.mendix.com/appstore/modules/community-commons-function-library):

  • RunMicroflowAsyncInQueue – This runs a microflow asynchronously (meaning, this function immediately returns and schedules the microflow to be run in the near future). The queue guarantees a first-come-first-serve order of the microflows, and only one action is served at a time. The microflow is run with system rights in its own transaction. This is very useful for running heavy microflows in the background.
  • executeMicroflowInBackground – This is similar to RunMicroflowAsyncInQueue, but it accepts one argument as parameter.

 

If this works for your situation I don’t know if subsequent actions depend on previous actions you need to resdign the flow for example as the actions are sort of fire and forget.

answered