locked
Accessing Variable value from hosting environment RRS feed

  • Question

  • Hello

    How can I access Variable value from hosting environment to get intermediate result while the WF is idle ?

    Where do I get activity context to achieve this ?

    Thanks

    LocationReference locRef = null;
    _wfApp.HostEnvironment.TryGetLocationReference ( "varName" , out locRef );
    locRef.GetLocation(activityContext??????).Value
    

    Wednesday, April 20, 2011 10:45 AM

Answers

  • I don't think it's possible to use an ActivityContext unless the activity itself is running. You could make it run again with bookmarks, if you're only worried about some specific custom activity... or use some kind of host extension, etc, otherwise, does this answer from another thread address your question?

    "Create a Persistence Participant for the workflow. Right before the workflow instance be persisted and unloaded. Code we wrote in the Persistence Participant class will store Variable values in another database(or files).
    So that we can query these variables. see:
    http://msdn.microsoft.com/en-us/library/ee473464.aspx
    Another way: We can promote some variables, and we can query this variables directly, see:
    http://msdn.microsoft.com/en-us/library/ee364726.aspx"
    Tim 
     
    • Marked as answer by Andrew_Zhu Wednesday, April 27, 2011 2:10 AM
    Friday, April 22, 2011 4:54 PM