2

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

2
  • Please, add information, what type of WF are you using? SP2010 or SP2013? As this workflow types and solutions for them are very different.
    – MikhailSP
    Apr 17, 2013 at 7:26
  • Ooops, I have just realized that this question was asked more than a year ago, but why it was shown to me as new? :). Sorry. Now it is obvious that it was a 2010 WF.
    – MikhailSP
    Apr 17, 2013 at 7:27

2 Answers 2

1

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.