public void DeployWorkflowActivities() { CrmServiceClient crmSvc = new CrmServiceClient(ConfigurationManager.ConnectionStrings["integration_testing"].ConnectionString); var userId = crmSvc.GetMyCrmUserId(); var trace = new TraceLogger(); var task = new DeployWorkflowActivitiesTask(crmSvc, trace); var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\..\TestWorkflowActivity"); task.Execute(path); }
private static void RunTask(CommandLineArgs arguments, IOrganizationService service, ITrace trace) { if (arguments.Path == null) { arguments.Path = Directory.GetCurrentDirectory(); } else { // Strip trailing \ arguments.Path = arguments.Path.TrimEnd('\\'); arguments.Path = Path.Combine(Directory.GetCurrentDirectory(), arguments.Path); } BaseTask task = null; string command = arguments.Task.ToLower(); switch (command) { case "plugins": trace.WriteLine("Deploying Plugins"); task = new DeployPluginsTask(service, trace); break; case "workflow": trace.WriteLine("Deploying Custom Workflow Activities"); task = new DeployWorkflowActivitiesTask(service, trace); break; case "webresources": trace.WriteLine("Deploying WebResources"); task = new DeployWebResourcesTask(service, trace); break; case "instrument": trace.WriteLine("Downloading Plugin/Workflow Activity Metadata"); task = new DownloadPluginMetadataTask(service, trace); break; case "download-webresources": trace.WriteLine("Downloading Webresources"); task = new DownloadWebresourceFileTask(service, trace) { Overwrite = arguments.Overwrite }; break; case "get-webresources": trace.WriteLine("Downloading Webresources"); task = new DownloadWebresourceConfigTask(service, trace); task.Prefix = arguments.Prefix; break; case "earlybound": trace.WriteLine("Generating early bound types"); var earlyBound = new EarlyBoundClassGeneratorTask(service, trace); task = earlyBound; earlyBound.ConectionString = arguments.Connection; break; case "unpack": trace.WriteLine("Unpacking solution"); var packager = new SolutionPackagerTask(service, trace); packager.command = command; task = packager; break; case "unpacksolution": trace.WriteLine("Unpacking solution Zip"); var unpackfromsolution = new SolutionPackagerTask(service, trace); unpackfromsolution.command = command; task = unpackfromsolution; break; case "pack": trace.WriteLine("Packing Solution"); var pack = new SolutionPackagerTask(service, trace); pack.command = command; task = pack; break; case "import": trace.WriteLine("Packing & Import Solution"); var import = new SolutionPackagerTask(service, trace); import.command = command; task = import; break; case "compare": trace.WriteLine("Comparing Solution"); var compare = new SolutionPackagerTask(service, trace); compare.command = command; task = compare; break; } if (task != null) { if (arguments.Profile != null) { task.Profile = arguments.Profile; } task.Execute(arguments.Path); } else { throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.NO_TASK_SUPPLIED, String.Format("Task '{0}' not recognised. Please consult help!", arguments.Task.ToLower())); } }
private static void RunTask(CommandLineArgs arguments, IOrganizationService service, ITrace trace) { if (arguments.Path == null) { arguments.Path = Directory.GetCurrentDirectory(); } else { // Strip trailing \ arguments.Path = arguments.Path.TrimEnd('\\'); arguments.Path = Path.Combine(Directory.GetCurrentDirectory(), arguments.Path); } BaseTask task = null; switch (arguments.Task.ToLower()) { case "plugins": trace.WriteLine("Deploying Plugins"); task = new DeployPluginsTask(service, trace); break; case "workflow": trace.WriteLine("Deploying Custom Workflow Activities"); task = new DeployWorkflowActivitiesTask(service, trace); break; case "webresources": trace.WriteLine("Deploying WebResources"); task = new DeployWebResourcesTask(service, trace); break; case "instrument": trace.WriteLine("Downloading Plugin/Workflow Activity Metadata"); task = new DownloadPluginMetadataTask(service, trace); break; case "get-webresources": trace.WriteLine("Downloading Webresources"); task = new DownloadWebresourceConfigTask(service, trace); task.Prefix = arguments.Prefix; break; case "earlybound": trace.WriteLine("Generating early bound types"); var earlyBound = new EarlyBoundClassGeneratorTask(service, trace); task = earlyBound; earlyBound.ConectionString = arguments.Connection; break; } if (task != null) { if (arguments.Profile != null) { task.Profile = arguments.Profile; } task.Execute(arguments.Path); } else { throw new SparkleTaskException(SparkleTaskException.ExceptionTypes.NO_TASK_SUPPLIED, String.Format("Task '{0}' not recognised. Please consult help!", arguments.Task.ToLower())); } }