Microflow is called in an endless loop

0
Hello, I am using a microflow on page start to retrieve a list of assets from an API that I developed outside mendix. I debugged what is happening I found the microflow is being called in an endless loop and data is retrieved multiple times. What is the cause of this ? and how to solve it ? Also I aan end event that retrieves a list, so I dont get why the end event does not stop since the list is already retrieved. I think it might be related to page refreshing on its own, since the microflow is called once the page starts through the list, but I am not sure is this what is happening or is it something else. Your help is really appreciated Thanks
asked
2 answers
5

The reason your microflow is called multiple times is that you are creating Asset_Entity objects in the source microflow for a ListView that displays Asset_Entity objects.  

Inside of the loop in your microflow, the create action is *probably* set to Refresh in client.  So each time you create a new object in that microflow, it will trigger a refresh in the page which means your microflow will execute again.  

One way to resolve this would be to call the microflow that retrieves objects from the REST service before you open the page.  Then set your ListView to retrieve from the database, instead of using a microflow.  This would mean that when you want to open this page, you would need to call a microflow to

  1.   etrieve the objects and
  2.   show the page

Hope that helps.

answered
0

Why don't you use a counter or index of the list?

You should not trust Mendix automation.

answered