public void ProvisionIncidentWorkflowAndRelatedLists(string incidentWorkflowFile, string suiteLevelWebAppUrl, string dispatcherName)
        {
            var incidentsList = CSOMUtil.GetListByTitle(clientContext, "Incidents");

            var service = new WorkflowProvisionService(clientContext);
            var incidentWF = System.IO.File.ReadAllText(incidentWorkflowFile)
                    .Replace("(SuiteLevelWebAppUrlPlaceholder)", suiteLevelWebAppUrl)
                    .Replace("(dispatcherPlaceHolder)", dispatcherName);
            var incidentWFDefinitionId = service.SaveDefinitionAndPublish("Incident",
                WorkflowUtil.TranslateWorkflow(incidentWF));
            var taskListId = service.CreateTaskList("Incident Workflow Tasks");
            var historyListId = service.CreateHistoryList("Incident Workflow History");
            service.Subscribe("Incident Workflow", incidentWFDefinitionId, incidentsList.Id,
                WorkflowSubscritpionEventType.ItemAdded, taskListId, historyListId);
        }
        public void RemoveIncidentWorkflowAndRelatedLists()
        {
            var incidentsList = CSOMUtil.GetListByTitle(clientContext, "Incidents");

            var service = new WorkflowProvisionService(clientContext);
            service.Unsubscribe(incidentsList.Id, "Incident");
            service.DeleteDefinitions("Incident");
            service.DeleteList("Incident Workflow Tasks");
            service.DeleteList("Incident Workflow History");
        }