I am trying to write a custom action by composing standard actions, one of which is the Assignment operation, which is responsible for assigning the OutArgument string value called βTextOutβ, which I defined in my custom Activity. The idea is that the author of the workflow that uses this custom activity identifies the variable in the workflow and maps it to the TextOut OutArgument of my user activity. I would like to achieve this with an iterative approach, since I have a requirement to dynamically create select branches at runtime. I abandoned this code to simplify my question.
Below is the action code. This is probably not how it should be done, because it does not work :) A workflow that uses this action causes a validation error: "The value for the required activity argument has not been provided to".
I would like to get some tips on how to get my OutArgument to work with the Assign child activity (so without calling .Set on my OutArgument).
public sealed class OutArgActivity : Activity
{
public OutArgument<string> TextOut { get; set; }
public OutArgActivity()
{
Assign assign = new Assign {
To = this.TextOut,
Value = new InArgument<string>(
env => "this is my custom return value")
};
Sequence sequence = new Sequence();
sequence.Activities.Add(assign);
this.Implementation = () => sequence;
}
}
source
share