Best Batching method?

0
I need to add a bool to every item, however we have 200k+ items. Trying to do this myself, I've run into runtime errors, seemingly no matter what. I've tried retrieving every 1000, adding the bool to each, then committing, and breaking it into sub microflows, but it just doesnt seem to work without a runtime error.    I don't have a great understanding of Mendix's garbage collector, and that's probably why I'm running into errors.    Any help on the best way to batch in this scenario would be appreciated!
asked
2 answers
0

Hi Remington, you can use Task Queue is one of the best ways to handle this in Mendix, especially with large datasets like 200k+ items. It avoids runtime and memory issues by offloading processing to background threads and reducing memory pressure from long-running loops.

 

Task Queue is a great fit even for something as simple as adding or updating a Boolean on 200k+ items. It is absolutely appropriate and recommended, even for a simple Boolean update, when you're working at this scale. It will save you from performance and runtime issues.

 

I hope this one helps you :)

answered
-1

For each checkbox, you need to create a separate Boolean attribute. Additionally, when the checkbox's value changes, you should trigger an on-change event, either by using a microflow or a nanoflow.

Here's a step-by-step breakdown:

  • Create a new Boolean attribute for each checkbox.
  • For each checkbox, add an on-change event microflow or nanoflow.
  • In the microflow or nanoflow, update the desired object with the new value of the checkbox.
  • Don't forget to set "refresh in client" to yes if you're using a microflow.

Example

Let's say you have a checkbox for "Pay by Credit Card". When its value changes, you'll want to update the object with the corresponding payment method.

Further Exploration

You might want to explore how to reuse common checks across multiple microflows by creating a new rule in Mendix. This could be a valuable technique for maintaining consistent validation logic across your application.

If this helps , accept my answer

5 references

 

answered