Forum list » General discussion »
Keeping track of workflow progress
Pages:  1
(36 posts)

Keeping track of workflow progress

Hi devs!

Is there any way to monitor the workflow progress programmatically? I'd like to poll the server each N seconds (ajax) to check the workflow state (assuming I will store some data in properties of the workflow instance) and update HTML page accordingly.

Cheers,

Andrzej

(144 posts)

Re:Keeping track of workflow progress

Hi!

When you start a workflow method with WAFContext.Session.StartWorkflowMethod(wf), it returns a WorkflowInfo object. The WorkflowInfo object contains two properties you need to use: InstanceId and PercentageCompleted. 

This combined with WAFContext.Session.GetWorkflowInfo(Guid instanceId) which you can use to look up the progress with each poll request, should get you going.

Also note that this is dependent on you setting the progress inside the workflow using WFContext.SetProgress.

Let us know how it works for you!

(36 posts)

Re:Keeping track of workflow progress

Thanks Vidar, exactly what I need. I will let you know when I get it up and running.