public void AddWorkflow(string wtype) { IBatchWorkflowFactory factory = BatchWorkflowFactory.GetInstance(); IBatchWorkflow workflow = factory.GetWorkflow(wtype); Workflows.Add(workflow); }
public IBatchWorkflow GetWorkflow(string type) { string typeClass = WorkflowClasses[type]; // This will throw an exception if type not found! Console.WriteLine($"Instantiating workflow class: {typeClass}"); var workflowType = Type.GetType(typeClass); IBatchWorkflow workflow = (IBatchWorkflow)Activator.CreateInstance(workflowType, type); return(workflow); }