How to get information from the workflow to the host? RRS feed

  • Question

  • Hello!

    What should I do in order to get information from the workflow to the host before completion of the workflow?

    As an example: Let's assume we have a workflow which never completes, but every hour it obtains the weather forecast, processes it, and the result should be notified to the host.

    Best regards,

    Henrik Dahl
    Wednesday, December 2, 2009 1:32 PM


All replies

  • I think you can use tracking for this. Tracking will allow you get information and data from your worflow while this one is running. This article gives you an overview about tracking: http://msdn.microsoft.com/en-us/library/aa663362.aspx

    This article explains in detail what tracking is and how to use it: http://msdn.microsoft.com/en-us/library/bb264458(VS.80).aspx

    Also, you can take a look at the WF tracking samples located here: http://msdn.microsoft.com/en-us/library/ms741724.aspx

    Hope this helps.
    Wednesday, December 2, 2009 4:56 PM
  • Thank you very much. Does it mean that there's no equivalent to the special activities which could be crafted using wca.exe in 3.5, simply the general tracking is the right means for this in 4.0?

    Wednesday, December 2, 2009 6:01 PM
  • The wca.exe tool will still be supported in .NET 4, so you can still use it.
    Wednesday, December 2, 2009 6:24 PM
  • The form of your verb "will" indicates that it's not currently supported in 4.0 Beta 2, but that it will be in 4.0 RTM, is that correct? (because then I'll wait dealing with it for RTM, obviously). I obvoiusly think of genuine 4.0 workflows and not 3.5 workflows hosted in the 4.0 compatibility way.
    Wednesday, December 2, 2009 6:40 PM
  • It is supported in 4.0 Beta 2 and it will be supported in .NET 4.
    Wednesday, December 2, 2009 6:42 PM
  • Is it simply the same directions for usage as in case of 3.5, it just generates 4.0-style activities?
    Wednesday, December 2, 2009 6:45 PM
  • If you are using WorkflowApplication, you can share data between the workflow and the host using an extension (the extension is added to the workflowApplication by the host and is shared between the workflow and the host).

    I you are using WorkflowServiceHost, you can use the out of the box messaging activities (like Send and SendReceiveReply) to expose data from your workflow.
    Wednesday, December 2, 2009 7:20 PM
  • Leon, can you point me to more information on how to create and use an extension in this scenario? Specifically, what do you do in the workflow to return the weather forecast to the client and what do you do in the client to retrieve the forecast?

    Thursday, December 3, 2009 5:10 PM