public void CreateHistoryEvent(SPWebInstance web, object workflowId, int eventId, object user, string duration, string outcome, string description, string otherData) { if (web == null) { throw new JavaScriptException(Engine, "Error", "A web must be supplied as the first argument."); } SPMember member; if (user is SPUserInstance) { member = (user as SPUserInstance).User; } else if (user is SPGroupInstance) { member = (user as SPGroupInstance).Group; } else { throw new JavaScriptException(Engine, "Error", "User must be a SPUser or SPGroup."); } SPWorkflow.CreateHistoryEvent(web.Web, GuidInstance.ConvertFromJsObjectToGuid(workflowId), eventId, member, TimeSpan.Parse(duration), outcome, description, otherData); }
private void WriteToHistoryLog(string description, string outcome) { SPWeb web = workflowProperties.Web; Guid workflow = workflowProperties.WorkflowId; TimeSpan ts = new TimeSpan(); SPWorkflow.CreateHistoryEvent(web, workflow, 0, web.CurrentUser, ts, outcome, description, string.Empty); }
public void CreateHistoryEvent(int eventId, object groupId, object user, string outcome, string description, string otherData) { SPMember member; if (user is SPUserInstance) { member = (user as SPUserInstance).User; } else if (user is SPGroupInstance) { member = (user as SPGroupInstance).Group; } else { throw new JavaScriptException(Engine, "Error", "User must be a SPUser or SPGroup."); } m_workflow.CreateHistoryEvent(eventId, groupId, member, outcome, description, otherData); }
/// <summary> /// Logging function that enters updates to the Workflow History list /// </summary> /// <param name="logMessage"></param> public void LogWFHistoryComment(string logMessage, SPWorkflowActivationProperties workflowProperties, Guid WorkflowInstanceId) { SPWorkflow.CreateHistoryEvent(workflowProperties.Web, WorkflowInstanceId, 0, workflowProperties.Web.CurrentUser, new TimeSpan(), "Update", logMessage, string.Empty); }