To get a detailed explanation, we need to have a little understanding on the following classes.
WorkflowServiceManager - This is the class used for configuring and upgrading of an installation of a Microsoft Azure Workflow
WorkflowDeploymentService - This class manages workflow definitions and workflow activity authoring.
WorkflowDefinition - Represents a SharePoint workflow definition and includes the workflow properties.
WorkflowDefinitionCollection - Client object collection of WorkflowDefinition class.
WorkflowSubscription - Class responsible for having subscriptions to the external workflow hosts such as Azure workflows.
WorkflowServicesManager workflowServicesManager = new WorkflowServicesManager(currentWeb);
// We can loop through the definitions.
foreach (WorkflowDefinition workflowDefinition in workflowDefinitions)
WorkflowSubscription workflowSubscription = new WorkflowSubscription(); workflowSubscription.DefinitionId = workflowDefinition.Id; workflowSubscription.Enabled = true; workflowSubscription.EventSourceId = listGuid; workflowSubscription.Name = workflowDefinition.DisplayName;
// Event types when the workflow need to trigger such as Item Adding, Update and Manual workflowSubscription.EventTypes = eventTypes; workflowSubscription.SetProperty("TaskListId", taskListID); workflowSubscription.SetProperty("HistoryListId", historyListID);
workflowSubscription.SetProperty("FormData, string.Empty); WorkflowSubscriptionService workflowSubscriptionService
= workflowServicesManager.GetWorkflowSubscriptionService(); workflowSubscriptionService.PublishSubscriptionForList(workflowSubscription, listGuid); }
May I ask a question?
I confuse about TaskListId, HistoryListId
So how to create or initialize these variables
Hello there, just became alert to your blog through Google, and found that it's truly informative. I am gonna watch out for brussels. I'll be grateful if you continue this in future. A lot of people will be benefited from your writing. Cheers! outlook 365 loginReplyDelete
Virtual office applications are an isolated office collaboration program that assists virtual offices. It allows online employees to get to know task list templatesReplyDelete
Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!! https://europa-road.eu/hu/kulonleges-gepszallitas-budapest.phpReplyDelete
A virtual office is a great way for your small business to save on the cost of renting an office space. If you want to know details about virtual office, check out glasgowvirtualoffices.co.uk.ReplyDelete
Excellent post! I wonder if computer software-based workflow automated can run seamlessly with workflow automation with mobile apps. This will bring huge benefits for small & large enterprises.ReplyDelete
By default 30-yr fixed-rate loans are displayed in the table below. canada mortgage calculator Despite the long process, securing an advert loan is vital for most businesses. mortgage calculatorReplyDelete