I have been using a State Machine workflow (SharePoint 2010).
- The Main State does not update the item.
- The Main State contains a OnWorkflowItemChanged.
- When the item is changed, it will setState back to the retrieveIncident again.
- The RetrieveIncident State will consume external service and update the item.
When we edit the item through SharePoint site, there is no problem, everything works fine. However, when the TimerJob edit the Item, it will sometimes loop through these two states (from 1 to 4 times).
I have tried using different update method (item.Update(), item.SystemUpdate() or item.SystemUpdate(false)), but it contains the same problem.
I have found out that when System Account updates the item, it will not trigger the onWorkflowItemChanged. So I guess that problem may come from the TimerJob that edit it?
what could be a workaround for this problem?