Get input from user with ActivityBuilder in WF 4
- by avi1234
Hi,
I am trying to write a simple activity that received from the user its name and printing "hello + username" message.
the problem is that i cannot access to the username input via code.
the function is:
static ActivityBuilder CreateTask1()
{
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("User_Name", new InArgument<string>());
var res = new ActivityBuilder();
res.Name = "Task1";
foreach (var item in properties)
{
res.Properties.Add(new DynamicActivityProperty { Name = item.Key, Type = item.Value.GetType(), Value = item.Value });
}
Sequence c = new Sequence();
c.Activities.Add(new WriteLine { Text = "Hello " + properties["User_Name"] });
res.Implementation = c;
return res;
}
The output of the followed will always be "Hello User_Name".
Thanks!