I am interested in timing arbitrary WorkflowApplication instances to see how long they spend “busy” and how long idle.
However, it seems that tracking notifications are only generated when the instance becomes Idle, and not when it is reactivated.
Is there an easy way of getting such a notification?
UPDATE:
WorkflowApplication wa = new WorkflowApplication(activity);
var tracker = new ConsoleTrackingParticipant()
{
TrackingProfile = new TrackingProfile
{
Name = "SampleTrackingProfile",
ImplementationVisibility = ImplementationVisibility.All
}
};
var query = new WorkflowInstanceQuery();
query.States.Add("*");
tracker.TrackingProfile.Queries.Add(query);
var brq = new BookmarkResumptionQuery()
{
Name = "*"
};
tracker.TrackingProfile.Queries.Add(brq);
wa.Extensions.Add(tracker);
wa.Run();
In almost every case a workflow goes idle because of a bookmark being created. And for the workflow to continue the bookmark must be resumed. With a TrackingParticipant you can receive a BookmarkResumptionRecord when this happens. In order to receive these you will need to configure a TrackingProfile and add a BookmarkResumptionQuery.