Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
        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));
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
            }
        }