JuanSalas
Novice

Multiple Workflow Instances

I have a K2 SharePoint workflow that starts when a smart form is submited (New Item). This workflow was created on a list where data already existed so I also added a rule to start the workflow if an item is edited and certain conditions are meet (Edit Item).

 

The workflow runs as expected but it’s possible that two or more workflow instances runs at the same time if, for example an item is created and then modified before the workflow is completed.

 

Is it possible to prevent a new instance of the workflow to be started if there is one already running? Or prevent the item edition if there is a workflow running?

0 Kudos
Reply
2 Replies
K2Expert1
Novice

Re: Multiple Workflow Instances

Hi Jaun,

 

Seems its not direct possible through list , you can do some workaround  as add a property in the list to maintain ISCompleted flag and on every process start check if this is first time then dont check but on second trigger check the flag if flag is true then continoue else complete the instance after check .

 

- Arvind

Reply
tschaef
Novice

Re: Multiple Workflow Instances

I had a similar issue, I have a workflow that sends email notifications. To ensure multiple emails weren't sent when someone made multiple changes to the same View, for each control with a rule to add a notification activity I created a hidden data label and I updated the rule that runs when the control is changed so that it runs only if that hidden data label is empty and the last part of the rule is data transfer to populate the hidden data label.

 

I still have an issue with clearing a hidden Data Label I use to combine workflow notifications. For example, I have a hidden Data Label (hdnViewNotifications) for each view on my form that combines all of the notifications that might be triggered on that View any time the form is filled out. To add a notification's name to the hdnViewNotifications control I use the Transfer Data and add the hdnViewNotification control and that specific notification's name with a comma after the activity, so that the hdnViewNotification combines all of the View's notifications in that single control (see attachment). Then when the form is saved a rule pulls each View's hdnViewNotification control to add all of the appropriate notifications to the workflow.

 

Sometimes users change a control so it adds the notification's name to the hdnViewNotifications and then reset the control. If a control that triggers a notification is reset, I would like to remove that specific notification's name from the hdnViewNotifications. Can anyone direct me on how to "clear" a specific notification name from the hdnViewNotifications control without clearing any other notification names that might have also been added to the control? Do I have to repopulate the hidden control with an expression created to remove the specific notification's name? If so, any pointers on how to build the expression would be greatly appreciated as I'm not very comfortable with expressions.

Reply