Here I have provided the code for you by using which you can create the program.cs file that would be helping you to send the parameters to the workflow file.
program.cs
Code:
class Program
{
static void Main(string[] args)
{
using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())
{
AutoResetEvent waitHandle = new AutoResetEvent(false);
workflowRuntime.WorkflowCompleted +=
delegate(object sender, WorkflowCompletedEventArgs e) {waitHandle.Set();};
workflowRuntime.WorkflowTerminated +=
delegate(object sender, WorkflowTerminatedEventArgs e)
{
Console.WriteLine(e.Exception.Message);
waitHandle.Set();
};
Console.Write("Insert your name: ");
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("Username", Console.ReadLine());
Type t = typeof(HelloWorkflow.Workflow1);
WorkflowInstance instance = workflowRuntime.CreateWorkflow(t, parameters);
instance.Start();
waitHandle.WaitOne();
Console.WriteLine("\n\n");
Console.WriteLine("Press any key to exit ...");
Console.Read();
}
}
}
Bookmarks