locked
"Invoke Workflow Synchronously" Problem RRS feed

  • Question

  • Hi,
    I've some problem with the Jon Flanders' sample, showing how to invoke workflow synchronously:
    http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,33cfb35c-aca7-4a5e-8b35-ff983b0b83e4.aspx

    1) ManualWorkflowSchedulerService
    Run workflow. It runs, calls the callee and finishes. So far so good.
    But it doesn't use the ManualWorkflowSchedulerService: in fact, Jon have not added this service to the Runtime, and in the CallWorkflowService.StartWorkflow() the runtime.GetService<ManualWorkflowSchedulerService>() return null.

    After adding ManualWorkflowSchedulerService, is it necessary to run the caller wf synchronously in the host?
    Why Jon have not added this service?


    2) WorkflowLoaded event
    As posted in http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=273748&SiteID=1:
    When you have the combination of ManualWorkflowSchedulerService, Delay activities, and Persistence (with UnloadOnIdle=true) you will have to manually call ManualWorkflowSchedulerService.RunWorkflow(workflowid) after the Delay expires.
    When the delay activity executes, the workflow will become idle and get unloaded by the persistence service.  The persistence service will eventually reload the workflow when it detects the delay time has elapsed.  However, the workflow will only be loaded - it will not resume execution automatically.  You will have to call ManualSchedulerService.RunWorkflow(workflowid) explicitly.

    So, is it necessary subscribing to WorkflowLoaded event and call the ManualWorkflowSchedulerService.RunWorkflow() method in it?


    3) QueueItemAvailable
    After adding ManualWorkflowSchedulerService and WorkflowLoaded event subscription, the caller doesn't receive the QueueItemAvailable event, but only the QueueItemArrived, and so the caller doesn't Dequeue from its WorkflowQueue and never complete.

    Solution?


    Any suggestion would be greatly appreciated.
    Wednesday, August 1, 2007 12:58 PM

Answers