コード例 #1
0
        public static Guid GetOneInstalledWorkflow(ref ClientContext clientContext, ref WorkflowServicesManager wfServiceManager)
        {
            WorkflowDeploymentService depService       = wfServiceManager.GetWorkflowDeploymentService();
            bool showPublishedWorkflows                = true;
            WorkflowDefinitionCollection wfdefinitions = depService.EnumerateDefinitions(showPublishedWorkflows);

            clientContext.Load(wfdefinitions);
            clientContext.ExecuteQuery();
            Console.WriteLine(wfdefinitions.First().DisplayName);
            return(wfdefinitions.First().Id);
        }
コード例 #2
0
        /// <summary>
        /// Get one installed workflow definition.
        /// </summary>
        public static Guid GetOneInstalledWorkflow(ref ClientContext clientConext,
                                                   ref WorkflowServicesManager wfServicesManager)
        {
            // connect to deployment service
            WorkflowDeploymentService depService = wfServicesManager.GetWorkflowDeploymentService();

            // get all installed workflows
            bool showOnlyPublishedWorkflows           = true;
            WorkflowDefinitionCollection wfDefintions = depService.EnumerateDefinitions(showOnlyPublishedWorkflows);

            clientConext.Load(wfDefintions);
            clientConext.ExecuteQuery();

            return(wfDefintions.First().Id);
        }
コード例 #3
0
        public static void ShowAllInstalledWorkflows(ref ClientContext clientContext, ref WorkflowServicesManager wfsm)
        {
            //connect to deployment service
            WorkflowDeploymentService depService = wfsm.GetWorkflowDeploymentService();

            // get all installed workflows
            bool showOnlyPublishWorkflows            = true;
            WorkflowDefinitionCollection definitions = depService.EnumerateDefinitions(showOnlyPublishWorkflows);

            clientContext.Load(definitions);
            clientContext.ExecuteQuery();
            foreach (var def in definitions)
            {
                Console.WriteLine("Workflow ID: {0} - Workflow Name: {1}", def.Id, def.DisplayName);
            }
        }
コード例 #4
0
        /// <summary>
        /// Write out all installed workflows.
        /// </summary>
        public static void ShowAllInstalledWorkflows(ref ClientContext clientConext,
                                                     ref WorkflowServicesManager wfServicesManager)
        {
            // connect to deployment service
            WorkflowDeploymentService depService = wfServicesManager.GetWorkflowDeploymentService();

            // get all installed workflows
            bool showOnlyPublishedWorkflows           = true;
            WorkflowDefinitionCollection wfDefintions = depService.EnumerateDefinitions(showOnlyPublishedWorkflows);

            clientConext.Load(wfDefintions);
            clientConext.ExecuteQuery();

            // write all
            Console.WriteLine();
            Console.WriteLine("All Installed Workflows:");
            foreach (WorkflowDefinition wfDefintion in wfDefintions)
            {
                Console.WriteLine("{0} - {1}",
                                  wfDefintion.Id,
                                  wfDefintion.DisplayName);
            }
        }