A customer enabled workflow logging following the instructions in KB972914. He asked what “ManualWorkflowSchedulerService: CanRun is False” meant in WF logging. And is it normal?

 

As you know, if we use ManualWorkflowSchedulerService, we need to call RunWorkflow method manually. Let us check the pseudo code of this method:

 


       public bool RunWorkflow(Guid workflowInstanceId)
       {

               …
           bool retval = false;
           while (CanRun(workflowInstanceId))
           {
               …
               if (RunOne(workflowInstanceId) || ProcessTimer(workflowInstanceId))
                   retval = true;
               else
                   break;
               …
           }
              …
       }

 

 

CanRun method will be called repeatedly until it returns false.

CanRun will check whether there are scheduled workflow instances. If there is, it will return true. Then RunOne will be called to execute the workflow instance.



If there is no scheduled instance, CanRun will return false. And the thread will exit the while loop in RunWorkkflow.



Therefore it is normal that we see “ManualWorkflowSchedulerService: CanRun is False” in trace file. It means there is no scheduled instance to be executed.



Regards,

 

Xin Jin from APGC DSI Team