After all I was able to do it this way. Not exactly what I wanted but it should do.
Hope it will help someone:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Activities.Statements;
using Microsoft.VisualBasic.Activities;
using System.Activities.Expressions;
using System.Reflection;
namespace ConsoleApplication1
{
public class ChildActivity : NativeActivity<double>
{
public InArgument<String> MyChildInArgument { get; set; }
public OutArgument<String> MyChildOutArgument { get; set; }
protected override void Execute(NativeActivityContext context)
{
String test = MyChildInArgument.Get(context);
}
}
public class ParentActivity : Activity
{
public InArgument<String> MyParentInArgument { get; set; }
public OutArgument<String> MyParentOutArgument { get; set; }
protected override Func<Activity> Implementation
{
get
{
return () =>
{
Sequence seq = new Sequence
{
Activities =
{
new WriteLine()
{
Text = "Before",
},
new ChildActivity()
{
MyChildInArgument = new InArgument<String>(new VisualBasicValue<String>("MyParentInArgument")),
},
new WriteLine()
{
Text = "After",
},
new Assign
{
To = new OutArgument<string>(new VisualBasicReference<string>("MyParentOutArgument")),
Value = new InArgument<string>(new VisualBasicValue<string>("MyParentInArgument"))
},
}
};
return seq;
};
}
set
{
base.Implementation = value;
}
}
}
class Program
{
static void Main(string[] args)
{
ParentActivity myTest = new ParentActivity()
{
MyParentInArgument = new InArgument<string>("TEST"),
};
var output = WorkflowInvoker.Invoke(myTest);
}
}
}