我正在尝试编写一个简单的活动,该活动从用户那里收到其名称并打印“hello + username”消息。
问题是我无法通过代码访问用户名输入。
功能是:
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;
}
跟随的输出将始终是“Hello User_Name”。
谢谢!