Not applicable

ForEach running inside a Loop - random crashing

Jump to solution

Hi,

 

I have a workflow on a Library that involves running a Loop a varying number of times depending on the original number of items in a collection (count/160 into integer variable & then +1). Within that Loop, I have a ForEach limited to running 160 times, during each run removing one collection item. After the 160 runs it exits the ForEach, runs an UpdateListItems webservice on a List within the site, resets/recalculates some variables, and reenters the loop.

 

The logic appears to be functioning just fine - it loops the correct number of times, runs the ForEach the correct number of times, calls the web service, and creates the items correctly. But I am getting random workflow errors popping up at different points throughout the process part way through the ForEach runs. Is there a way to trace exactly what is causing the errors?

 

Thanks.

0 Kudos
Reply
2 Replies
jan
Nintex Newbie

Re: ForEach running inside a Loop - random crashing

Jump to solution

In Central Admin, under the Nintex Workflow global settings turn on "Allow verbose logging". In your workflow settings you can now select the option to enable verbose logging. This will give you additional information in the Nintex workflow history.

 

I suspect your issue is related to batching. I.e. some actions are getting executed out of order. After your web service call try inserting a "Commit Pending" action. If that does not work you can try putting in a delay.

View solution in original post

0 Kudos
Reply
Not applicable

Re: ForEach running inside a Loop - random crashing

Jump to solution

Hi Jan,

Thanks. Being able to do verbose logging helped track down the problem - I was removing items from the collection too early in the sequence of events & therefore trying to carry out an action on a collection index that no longer existed!

Assistance much appreciated 🙂

0 Kudos
Reply