I have this process model which loops continuously and checks if any new value is inserted. After 1000 instances i started getting above error in the node highlighted and the Process model gets paused. How can i control this issue and make the process model run continuously ?
Discussion posts and replies are publicly visible
@Siddharth,
The default limit on the number of times a node can execute is 1000.There are couple of options to overcome this.1. Select the option "delete previously completed/cancelled instances" in other tab.2. Create Sub process and send the data in batches(1000 per loop) to that sub process and put the spawning inside the sub process.
does deleting previous instances a good way?
Instead I'd suggest having a new parent process that calls the current process, and handles the looping and timer. Strip down the process you already have such that all it does is one instance of the work. In the parent, you could make a timer-based loop, and store a counter that counts up to a value less than 1000 (i'd suggest starting smaller than you need, like 10 or 100), and when the process reaches that counter, have it call a new copy of itself via the Start Process Smart Service, then exit. That way you'll never get close to the MNI / node execution limit of 1000 instances.
is there any function that i can use to count the active instance of the process model ?
yes -- in my example scenario above, you simply add an integer PV (i.e. pv!counter) and initialize it to 1, then add 1 to it for every completed loop, and each loop you would pass through an XOR gateway and leave the flow if the counter is over a certain value, i.e. 100.
Thanks a ton.