var workflow = new Sequence();
Variable<Dictionary<string,object>> variable = new Variable<Dictionary<string,object>>
{
Name = "SharedData"
};
workflow.Variables.Add(variable);
foreach (MyCustomActivity activity in mAddedActivities)
{
workflow.Activities.Add(activity);
}
WorkflowInvoker invoker = new WorkflowInvoker(workflow);
invoker.Invoke();
This is what i Did for the actual implementation, there is no need of any inargument/outargument, The variable "Shared Data" is capable enough to hold the data across activities.
Now at each activity level in overridden code activity "Execute" method, you must use this excerpt of code to fetch input/fetch the value of this workflow variable, "SharedData".
WorkflowDataContext dataContext = context.DataContext;
PropertyDescriptorCollection propertyDescriptorCollection = dataContext.GetProperties();
foreach (PropertyDescriptor propertyDesc in propertyDescriptorCollection)
{
if (propertyDesc.Name == "SharedData")
{
myData = propertyDesc.GetValue(dataContext) as Dictionary<string, object>;
if (myData == null) //this to check if its the initial(1st) activity.
myData = new Dictionary<string, object>();
//I'm adding here an additional value into the workflow variable
//its having signature same as that of workflow variable
//dictionary's key as what it is and value as an object
//which user can cast to what actually one wants.
myData.Add("islogonrequired", Boolean.TrueString);
//here I'm fetching some value, as i entered it in my previous activity.
string filePath = myData["filepath"].ToString();
propertyDesc.SetValue(dataContext, myData);
break;
}
}
Hope this might help others..
Thanks everyone else out there for their help n support.