/// <summary>
/// Updates an audit event after the method is invoked.
/// </summary>
protected virtual void UpdateAuditEvent(
ISystemContext context,
MethodState causeMethod,
uint causeId,
AuditUpdateStateEventState e,
ServiceResult result)
{
TranslationInfo info = new TranslationInfo(
"StateTransition",
"en-US",
"The {1} method called was on the {0} state machine.",
this.GetDisplayPath(3, '.'),
causeMethod.DisplayName);
e.Initialize(
context,
this,
EventSeverity.Medium,
new LocalizedText(info),
ServiceResult.IsGood(result),
DateTime.UtcNow);
e.MethodId = new PropertyState <NodeId>(e);
e.MethodId.Value = causeMethod.NodeId;
e.SetChildValue(context, BrowseNames.OldStateId, LastState, false);
e.SetChildValue(context, BrowseNames.NewStateId, CurrentState, false);
}