/// <summary> /// Reports an audit event for the cause. /// </summary> protected virtual void ReportAuditEvent(OperationContext context, Transition transition, QualifiedName cause, Exception exception) { AuditUpdateStateEvent e = CreateAuditEvent(context, transition, cause, exception); e.InitializeNewEvent(); e.Message.Value = Utils.Format("Method {0} was called.", cause); e.SourceNode.Value = NodeId; e.SourceName.Value = "Method/Call"; e.Severity.Value = 1; e.ReceiveTime.Value = DateTime.UtcNow; e.ActionTimeStamp.Value = DateTime.UtcNow; e.OldStateId.Value = m_currentStateName.StateNumber; e.NewStateId.Value = m_currentStateName.StateNumber; if (context != null) { e.ClientAuditEntryId.Value = context.AuditEntryId; e.ClientUserId.Value = context.Session.Identity.DisplayName; } if (transition != null) { e.OldStateId.Value = transition.FromState.StateNumber; e.NewStateId.Value = transition.ToState.StateNumber; } ReportEvent(e); }
/// <summary> /// Creates an audit event for the cause. /// </summary> protected virtual AuditUpdateStateEvent CreateAuditEvent( OperationContext context, Transition transition, QualifiedName cause, Exception exception) { return(AuditUpdateStateEvent.Construct(Server)); }