Developer Forum »
Keeping track of workflow progress
36 posts

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

181 posts

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

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

1