call java action sorting

0
Hi, We are using the executeMicroflowInBatches java action to run one of our microflows in batches as it was hitting a stack overflow error. I would like the list of objects that the call java action retrieves to be sorted. Does anyone know how to do this?
asked
2 answers
0

An option could be like;

- create a contextObject which keeps track of the processed records by having a startIndex and batchSize,

so you start with startIndex of 0 and batchsize 1000 in your first execution, update your contextObject then and pass it through to the java action so that it starts in the 2nd run by retrieving it from the updated startIndex and batch (1000-1000)

-execution should stop when there is no retrieve results

answered
0

In my experience, you can't solve a stack overflow error with batches: batching solves heap space error and GC overhead exceeded errors. If you have a stack overflow error, you probably have a recursive microflow which does not terminate nicely.

 

Furthermore, you shouldn't use executeMicroflowInBatches: since Mendix 4, Mendix supports the batching pattern natively. See section 5.2.1 of this page for an example of how to implement batching in Mendix.

answered