Symptoms
K2 Workflows are no longer triggering on item added or Updated on an SP list.
Diagnoses
It was determined that this workflow was configured to start on both item added as well as item updated but without any start condition. It also makes use of an list item update event. When an item is added, it is added as the current user. This triggers the item added event listener, starts the workflow and the update list item event is executed as the K2 service account. The updating of the list item triggers the item updated event listener, and in turn start another process instance. The execution of the list item update event and the triggering of the item updated event receiver created a backlog of items in MSMQ. It appears in addition to the backlog in MSMQ, there was a process instance of this same workflow that was in a constant running state.
Resolution
To resolve the issue, the K2 blackpearl service was stopped, MSMQ was purged, and the K2 blackpearl service started back up. Below are some design considerations to not experience this Item Updated loop:
a. If using Sharepoint Forms, add a Boolean field to this list in the 'Update List Item' event, set this to False. Configure the Start condition for the 'Item Updated' event, such that it would only run if this Boolean field is True. When a user need to update this list item and wishes to start the workflow, they will have to manually change this Boolean field to True and save the changes.
b. If using K2 SmartForms, add a Boolean field to this list in the 'Update List Item' event, set this to False. Configure the Start condition for the 'Item Updated' event, such that it would only run if this Boolean field is True. Modify the 'Edit' View of the Edit SmartForm. On the Save Button click rule of this Edit View that would call the 'Update List Item' method, set the boolean field to True. This field can also be hidden on this Edit view to not confuse users.