Hi I have two workflows wf1 and wf2 on one list i've created in visual studio.
I need to check from within wf2 if wf1 is completed. (Usually I see not started, in progress and completed)
How can i do this programatically pls.
thanks
|
Hi I have two workflows wf1 and wf2 on one list i've created in visual studio. I need to check from within wf2 if wf1 is completed. (Usually I see not started, in progress and completed) How can i do this programatically pls. thanks |
|||||
|
|
According to this very thorough MSDN article: , you could do this by retrieving a list of running workflows from the appropriate list item (SPListItem.Workflows property), search this list for wf1 instance, and then use SPWorkflow.IsCompleted property to check if the wf1 is completed. |
|||
|
|
|
As a possible workaround which could work for both types of WF (SP2010 ans 2013), you can create a field which is keeping WF1 status. For instance, right after start WF1 sets value of the field to "Started", right before completing: "Completed". In such a case you can check value of this field in WF2. However, in this approach you could not handle situations when WF is canceled by user, but probably it is not necessary in your case. |
||||
|
|