I have created a workflow, and Im running it via WorkflowInstance.Run().
This workflow has numerous bookmarks, and I would like to be able to query it for which
bookmark is responsible for the current idle-state.
How might I do this?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
for workflow 4.0
You can get the Bookmarks from the WorkflowInstance
Only active bookmarks, that is bookmarks that are actually waiting for something will be listed. In a sequential workflow without parallel activities that will tell you the one that is waiting. But in many situations there will be more than one bookmark waiting for input. You can’t tell which one caused an idol state.
You might be able to get more information by hooking something up to the WorkflowInstance.OnIdle event. It’s not quite a true .NET event, but it accomplishes the same thing. That won’t tell you exactly why you hit the Idle state, but hopefully knowing the timing will tell you more.
for workflow 3.0
I’m not sure this will help, but since you have a WorkflowInstance you can ask it for a collection of WorkflowQueueInfo objects by calling GetWorkflowQueueData(). The WorkflowQueueInfo class will tell you which activities are subscribed to the queue and if the queue has items in it. An empty queue with activities subscribed to it could show you what you need. Those activities are waiting for something but there is nothing to do. That should be the bookmark you are looking for.