예제 #1
0
        public static void LogMessage(ActivityExecutionContext executionContext, SPWorkflowHistoryEventType eventType, string outcome, string message, int userID, bool ccULS)
        {
            try
            {
                //write to Workflow History List
                ISharePointService spService = (ISharePointService)executionContext.GetService(typeof(ISharePointService));
                spService.LogToHistoryList(executionContext.ContextGuid, eventType, userID, TimeSpan.MinValue, outcome, message, message);

                //Write to ULS trace log
                if (ccULS)
                {
                    string source = executionContext.Activity.Name;
                    TraceProvider.TraceSeverity traceSeverity = TraceProvider.TraceSeverity.InformationEvent;

                    if (eventType == SPWorkflowHistoryEventType.WorkflowError)
                    {
                        traceSeverity = TraceProvider.TraceSeverity.Exception;
                    }

                    ULS.LogMessage(source, message, "Site Management", traceSeverity);
                }
            }
            catch (Exception ex)
            {
                EventLog.WriteEntry("SiteManagementActivity", "History Logging Failed:" + ex.ToString());
            }
        }
 public static void LogToWorkflowHistory(this SPWorkflowActivationProperties workflowProperties, SPWorkflowHistoryEventType type, string description, string outCome)
 {
     workflowProperties.LogToWorkflowHistory(type, workflowProperties.Site.SystemAccount, description, outCome);
 }
 public static void LogToWorkflowHistory(this SPWorkflowActivationProperties workflowProperties, SPWorkflowHistoryEventType type, SPMember user, string description, string outCome)
 {
     SPWorkflow.CreateHistoryEvent(workflowProperties.Web, workflowProperties.WorkflowId, (int)type, user, TimeSpan.MinValue, outCome, description, string.Empty);
 }
예제 #4
0
 public static void LogMessage(ActivityExecutionContext executionContext, SPWorkflowHistoryEventType eventType, string outcome, int userID, string message)
 {
     LogMessage(executionContext, eventType, outcome, message, userID, true);
 }