locked
WF codeactivity - variables, arguments and sharing data between activities RRS feed

  • Question

  • I have a CodeActivity and want it to return a List<string> and then be used in a Foreach loop immediately after.

    How do I get the List from the custom code activity to the foreach loop collection?

    Im confused about arguments and variables in this case.  Do I need an assign activity between these two?

    CodeActivity > Foreachloop

    or

    CodeActivity > Assign > Foreachloop

    If I have an out argument in the codeactivity, can I just use it in the Foreach?

    Friday, June 21, 2013 9:31 PM

Answers

  • You need to declare a variable in a scope that contains both your CodeActivity and the ForEach activity. Typically this is a Sequence or a FlowChart. Then you have to bind the Result of your code activity, and the Values in-argument of the ForEach activity to this variable. You don't need the assign activity, just the variable.
    • Marked as answer by Molly Chen_ Friday, June 28, 2013 8:57 AM
    Monday, June 24, 2013 8:31 AM