[WF4]Arguments In WF4

Problem:

How to pass parameters into workflow when started.

How to pass result out when workflow finished.

Solution: Use Arguments

1. InArgument

Sample:

Project Structure:

Activity:

Host:

Result:

 

2.OutArgument

Sample:

Project Structure

ActivityWithOutArgument:

Host

Result:

 

Note:

If we use WorkflowApplication to run workflow in another thread other than use WorkflowInvoder method. the code of host will be a little different.

In InArgument sample:

Host _1:

Result of Host_1:

Host_2

Result of Host_2

 

In OutArgument sample

Host

Result

blog comments powered by Disqus