private static void RemoveWorkflow(ClientContext context) { //Construct object with workflow template info WorkflowTemplateInfo solutionInfo = new WorkflowTemplateInfo(); //Package Guid is mandatory solutionInfo.PackageGuid = workflowUserSolutionId; solutionInfo.PackageName = Path.GetFileNameWithoutExtension(solutionPath); //Init workflow template deployer using (WorkflowTemplateDeployer workflowDeployer = new WorkflowTemplateDeployer(context)) { //Deactivate workflow template workflowDeployer.DeactivateWorkflowSolution(solutionInfo); //Remove workflow template files workflowDeployer.RemoveWorkflowSolution(Path.GetFileName(solutionPath)); } }
private static void RemoveWorkflow(ClientContext context) { //Construct object with workflow template info WorkflowTemplateInfo solutionInfo = new WorkflowTemplateInfo(); //Package Guid is mandatory solutionInfo.PackageGuid = workflowUserSolutionId; solutionInfo.PackageName = Path.GetFileNameWithoutExtension(solutionPath); //Init workflow template deployer using (WorkflowTemplateDeployer workflowDeployer = new WorkflowTemplateDeployer(context)) { //Deactivate workflow template workflowDeployer.DeactivateWorkflowSolution(solutionInfo); //Remove workflow template files workflowDeployer.RemoveWorkflowSolution(Path.GetFileName(solutionPath)); } }
private static void ProvisionWorkflow(ClientContext context) { //Construct object with workflow template info WorkflowTemplateInfo solutionInfo = new WorkflowTemplateInfo(); solutionInfo.PackageFilePath = solutionPath; //PackageName is mandatory solutionInfo.PackageName = Path.GetFileNameWithoutExtension(solutionPath); //Guid is automatically predefined in template file (wsp) solutionInfo.PackageGuid = workflowUserSolutionId; //Workflow feature Id is need to activate workflow in the web solutionInfo.FeatureId = workflowFeature; //Init workflow template deployer using (WorkflowTemplateDeployer workflowDeployer = new WorkflowTemplateDeployer(context)) { //Provisiong workflow resources workflowDeployer.DeployWorkflowSolution(solutionPath); //Activates workflow template workflowDeployer.ActivateWorkflowSolution(solutionInfo); } }
private static void ProvisionWorkflow(ClientContext context) { //Construct object with workflow template info WorkflowTemplateInfo solutionInfo = new WorkflowTemplateInfo(); solutionInfo.PackageFilePath = solutionPath; //PackageName is mandatory solutionInfo.PackageName = Path.GetFileNameWithoutExtension(solutionPath); //Guid is automatically predefined in template file (wsp) solutionInfo.PackageGuid = workflowUserSolutionId; //Workflow feature Id is need to activate workflow in the web solutionInfo.FeatureId = workflowFeature; //Init workflow template deployer using (WorkflowTemplateDeployer workflowDeployer = new WorkflowTemplateDeployer(context)) { //Provisiong workflow resources workflowDeployer.DeployWorkflowSolution(solutionPath); //Activates workflow template workflowDeployer.ActivateWorkflowSolution(solutionInfo); } }