Case when a workflow running at the same time


Badge +6

Hello everyone,

I have an issue which required your help. I make a formĀ  for purchase request and it linked with a "huge" workflow. My problem come from the fact that if two request was submit in the same time (maybe 2 or 3 second). One of them finish but an error occured for the second. This issue come from an update item action.

Indeed, I make an title with auto-increment id and I think that's the execution of both workflow at the same time is critical because the different action of the workflow cannot be done at the same time.

Does anyone face to this issue and find a solution ?

Br

ThƩo


12 replies

Badge +9

From your description I feel that the issue is due to the Auto increment title column.When 2nd workflow triggers before completion of first workflow the "ID" is at discrepancy due to the fact that "ID" for the first workflow is not generated. For testing purpose give hardcoded name to the file and try to trigger 2 workflows at a same time.

I guess you need to map different column instead of ID to make your title. Use this approach to create auto increment column https://www.nothingbutsharepoint.com/2010/06/03/sharepoint-how-to-create-an-auto-incrementing-number-field-for-use-in-a-custom-id-part-1-aspx/

Badge +7

You may want to try to control the execution of the workflow by having a parent workflow then calling the Start workflow action.

193493_pastedImage_1.png

Badge +6

Hi Jan, I've already try this fix but in my case, this action is so much long and it's not possible in this case.

Badge +6

Thanks, I will try the solution describe in the link and I get back to you;

Userlevel 5
Badge +14

running two instances of the workflow on two different items should be a problem.

... unless the workflow do make updates to the other item as well.

what's the error you get?

how do you implement auto increment?

can you post config of failing update action?

Badge +6

I have followed the tutorial but indeed, he used a workflow to increment the master data list so it's not good in my case.

Badge +6

Hi Marian,

Workflow status : Error occured

More detail : The workflow could not update the item, because it is possible that the columns for this item requires a different type of information.

Process :

List A with a workflow : One item where title = "master" and myid = 1

List B with the main workflow : When an item was created, the workflow start. The workflow automatically get item from List A, item "master" and add "+1" to "myid" and finished by an update item

Userlevel 5
Badge +14

have you checked you get correct result from List A lookup query?

I do not know how do you ensure increment of master record on List A, but I would say this approach can not be reliable since within sharepoint you can not ensure that two lookups into list A made at (about) the same time do not read the same myid value.

Badge +16

I have seen this error happen before when the initiator doesn't have permission to do the update - could that be the case? Also are you making use of commit pending changes as appropriate?

Badge +6

Hi Cassy, it's not the case because all people have access to this library (read) and I even used commit pending changes as appropriate.

Badge +6

Hi Marian, yes the result is correct when I launch a request and after 30 seconds, I launch a second request (I don't have really count but it's approximate). But yes, you're right this approach is not reliable.

To tacle this problem, for the moment, I used the technical ID of item because I think that it was calculated first when you submit any form so you don't have the "lag" between all actions of the workflow (e.g : make an ID in list A, store data and finally update item).

Badge +6

For now, the only solution that I've found is to used the technical ID of the item in my title. With this workaround, Sharepoint is able to update correctly the title.

Honestly, this solution is "dirty" because I don't have the control of this ID. In my case for example, I need to reboot to 0 every years this ID and I can't ...

Hope someone find another tips =)

Reply