Monday, May 11, 2015

Nintex 2013 Workflow Action: "Commit pending changes"


Commit pending changes is not well known action of Nintex, However very useful when you have scenario like I faced. 

I had a requirement like first to update the list item, and immediately need to take the count of updated items.

I spent quite amount of time to achieve this, First tried by doing simple workflow

1. Update list item

2. Query list (query the same list which updated)




Here after running this, started getting uncertain results. Sometime it works and fails.

Started applying workarounds to that

Tried to apply “Pause for” action in between, like below image.







Result was again uncertain, it pause was getting struck, was not resuming the workflow even after specified time.

I goggled and found many issues are reported for the same issue,

https://community.nintex.com/thread/2979

Third workaround was to add some loop which can add some pause before query, somehow even after safe loop, result was uncertain.


Finally found the impressive feature of Nintex, which has saved from all these hassles.

“Commit Pending Changes” – How exactly it is working ?

SharePoint workflow not starting the workload immediately, that means if I am adding update list item action, so its not sure that it will go and update the item at the same time, SharePoint doing batch job for it. As a result we are getting wrong result while querying it immediately.

As well other important thing to remember that The SharePoint workflow engine doesn't necessarily commit batched operations in the order they are displayed on the designer

Commit Pending Changes will wait/pause the workflow or say it waits until the workflow commits all other batch job started then after will move further.





This is very useful when you want workflow engine to follow the order you specified in workflow designer, or where the scenario where dependency on next to next actions.

Impressed with this Workflow action, Hope this piece of information will save your time!