Does WF4 have the ability to search for instances?
I have a WF4 workflow service deployed in AppFabric. Is there any开发者_如何转开发 built-in way to do a generic search across all currently active workflow instances?
For example, "get me a list of all active instances that have variable x = 5"?
If someone could point me in the right direction on this it would be much appreciated.
You can do so using the WorklfowInstanceStore database that is created. This will have an entry for every workflow that is running. Next you can configure property promotion to extract values from the workflow and have them stored in the database. The System.Activities.DurableInstancing.InstancePromotedProperties view will let you query for the values and give you the workflow InstanceId.
See here for an example on how to get started. One nice way to extract values without using a custom activity to do so is using a workflow tracking participant.
精彩评论