public void SetTaskList(SPListInstance list) { if (list == null) { throw new JavaScriptException(this.Engine, "Error", "A SPList must be supplied as the first argument."); } m_workflowAssociation.SetTaskList(list.List); }
public SPWorkflowCollectionInstance CreateWorkflowFromList(SPListInstance list, object associationId) { if (list == null) { throw new JavaScriptException(Engine, "Error", "A list must be supplied."); } var result = associationId == Undefined.Value ? new SPWorkflowCollection(list.List) : new SPWorkflowCollection(list.List, GuidInstance.ConvertFromJsObjectToGuid(associationId)); return(new SPWorkflowCollectionInstance(Engine.Object.InstancePrototype, result)); }
public ObjectInstance CountWorkflowsInList(SPListInstance list) { if (list == null) { throw new JavaScriptException(this.Engine, "Error", "An instance of a SPList object must be supplied as the first argument."); } var result = m_workflowManager.CountWorkflows(list.List); var obj = this.Engine.Object.Construct(); foreach (var r in result) { obj.SetPropertyValue(r.Key.ToString(), r.Value, false); } return(obj); }
public SPWorkflowAssociationInstance CreateWebAssociation(SPWorkflowTemplateInstance template, string name, SPListInstance taskList, SPListInstance historyList) { if (template == null) { throw new JavaScriptException(this.Engine, "Error", "A workflow template must be supplied as the first argument."); } if (taskList == null) { throw new JavaScriptException(this.Engine, "Error", "A task list must be supplied as the third argument."); } if (historyList == null) { throw new JavaScriptException(this.Engine, "Error", "A history list must be supplied as the fourth argument."); } var result = SPWorkflowAssociation.CreateWebAssociation(template.SPWorkflowTemplate, name, taskList.List, historyList.List); return(result == null ? null : new SPWorkflowAssociationInstance(this.Engine.Object.InstancePrototype, result)); }