Hi Guys,
This simple code fails with the following error:
The following errors were encountered while processing the workflow tree:
'ArgumentValue': The argument named 'Parameter' could not be found on the activity owning these private children. ArgumentReference and ArgumentValue should only be used in the body of an Activity definition.
I also tried VisualBasivValue("Parameter") instead of ArgumentValue, and the error was:
The following errors were encountered while processing the workflow tree:
'VisualBasicValue': Compiler error(s) encountered processing expression "Parameter". 'Parameter' is not declared. It may be inaccessible due to its protection level.
How to do it properly?
I tried to build something similar in Xaml, and it works, here is the code:
<Assign sap:VirtualizedContainerService.HintSize="242,58">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[variable]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[Parameter]</InArgument>
</Assign.Value>
</Assign>
Looks like it references the parameter somehow, but how...
How can I do it in code? Here is my simple scenario:
public class RootActivity : NativeActivity
{
public InArgument<string> Parameter { get; set; }
public Activity Activity { get; set; }
public RootActivity()
{
var variable = new Variable<string>("V1", "This is my variable!");
var activity = new Sequence
{
Variables = {variable},
Activities =
{
new Assign<string>
{
To = new OutArgument<string>(variable),
Value = new InArgument<string>(
new ArgumentValue<string>("Parameter"));
},
}
};
this.Activity = activity;
}
protected override void Execute(NativeActivityContext context)
{
context.ScheduleActivity(this.Activity);
}
}
Thanks a lot for any help!