Async Web client integrating with Windows Workflow Foundation (WF4)

I am designing a workflow using WF4 that is supposed to be consumed by a Web client. The workflow aggregates WCF services and is triggered by a Receive activity that is in turn spawned from a Web page. While the workflow is being executed, the user's Web session is active, and certain workflow activities may need to inform a user, ie Web page needs a feedback about certain workflow stages.

I would like to stick to WCF-based activities (Send, Receive etc.), but not quite certain how to implement feedback to a Web page. Let's say this is the scenario:

  • User clicks "Start" button on a Web page to start a workflow.
  • Workflow service creates a workflow instance and responds with a instance Id.
  • Next, "DoSomething" activity is executed on a server
  • When DoSomething is completed, user should be presented a new Web page. 5-NNN. Other activities are executed, some of them also requiring feedback.
  • Steps 1-2 can be implemented using ReceiveAndSendReply compound activity that consists of Receive and SendReply. Step 3 is some custom Code activity that completes shortly My first thought about step 4 is that it can be implemented using Send activity, but then Web application should act as a WCF service and provide an endpoint which does not fit a Web client. How else this feedback can be implemented?

    Thanks in advance


    I think the easiest way is to have your web page poll from time to time. Use an AJAX call to check if there is something new to display and if so, update the page.

    Or after the web page has requester the workflow and has updated its page, have it do another call that simply blocks until there is something new to show. The workflow can't take too long for that though, because after around 60 seconds the call will simply timeout.

    Another solution might be trying to use Comet, but I don't have any experience with that.

    链接地址: http://www.djcxy.com/p/95860.html

    上一篇: 如果条件满足,WF4转到或运行活动

    下一篇: 与Windows Workflow Foundation(WF4)集成的异步Web客户端