locked
Extract variables in the parent activity. RRS feed

  • Question

  • On MSDN (http://msdn.microsoft.com/en-us/library/ff628993.aspx) its mentioned that 

    If variables to be extracted are specified by using name=”*”, then all variables within the current activity being tracked are extracted. In this case variables that are in scope but defined in parent activities are not extracted.

    How can I extract the variables that are defined in parent activities without specifying the variable name?


    Regards,
    Jaydeep

    Tuesday, September 25, 2012 10:26 AM

Answers

  • I don't think there's a standard way, but a non-standard solution could be to use WorkflowDataContext (blog) (MSDN) to extract variables from the parent activity scope, and then emit custom tracking records (MSDN).
    Tim
    • Proposed as answer by Tim Lovell-Smith Wednesday, September 26, 2012 9:10 PM
    • Marked as answer by LeoTang Friday, October 5, 2012 7:38 AM
    Tuesday, September 25, 2012 7:25 PM
  • Use the DataContext object.  It will work in *most* situations without any problems.

    Be aware, though, that the DataContext's scope is not universal.  If you have a composite activity, its child activities can not interact with the DataContext of the main workflow.  This is by design.

    • Marked as answer by LeoTang Friday, October 5, 2012 7:38 AM
    Wednesday, September 26, 2012 7:54 PM

All replies

  • I think you'll have to apply tracking to the parent activity who declared the variable.
    Tuesday, September 25, 2012 5:58 PM
  • I don't think there's a standard way, but a non-standard solution could be to use WorkflowDataContext (blog) (MSDN) to extract variables from the parent activity scope, and then emit custom tracking records (MSDN).
    Tim
    • Proposed as answer by Tim Lovell-Smith Wednesday, September 26, 2012 9:10 PM
    • Marked as answer by LeoTang Friday, October 5, 2012 7:38 AM
    Tuesday, September 25, 2012 7:25 PM
  • Use the DataContext object.  It will work in *most* situations without any problems.

    Be aware, though, that the DataContext's scope is not universal.  If you have a composite activity, its child activities can not interact with the DataContext of the main workflow.  This is by design.

    • Marked as answer by LeoTang Friday, October 5, 2012 7:38 AM
    Wednesday, September 26, 2012 7:54 PM