Ejemplo n.º 1
0
 protected Event(EventCoordinator coordinator, InvocationOrigin invocationOrigin)
 {
     this.localId          = coordinator.AllocateId();
     this.timestamp        = coordinator.TimeNow();
     this.executionOrigin  = coordinator.ExecutionOriginHere();
     this.invocationOrigin = invocationOrigin;
 }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = 1561563491;

                hashCode = (hashCode * 157) + Id.GetHashCode();
                hashCode = (hashCode * 157) + WorkflowID.GetHashCode();
                hashCode = (hashCode * 157) + ExecutionID.GetHashCode();
                hashCode = (hashCode * 157) + ExecutionOrigin.GetHashCode();
                hashCode = (hashCode * 157) + IsSubExecution.GetHashCode();
                hashCode = (hashCode * 157) + IsRemoteWorkflow.GetHashCode();
                hashCode = (hashCode * 157) + WorkflowName.GetHashCode();
                hashCode = (hashCode * 157) + AuditType.GetHashCode();
                hashCode = (hashCode * 157) + PreviousActivity.GetHashCode();
                hashCode = (hashCode * 157) + PreviousActivityType.GetHashCode();
                hashCode = (hashCode * 157) + PreviousActivityId.GetHashCode();
                hashCode = (hashCode * 157) + NextActivity.GetHashCode();
                hashCode = (hashCode * 157) + NextActivityType.GetHashCode();
                hashCode = (hashCode * 157) + NextActivityId.GetHashCode();
                hashCode = (hashCode * 157) + ServerID.GetHashCode();
                hashCode = (hashCode * 157) + ParentID.GetHashCode();
                hashCode = (hashCode * 157) + ExecutingUser.GetHashCode();
                hashCode = (hashCode * 157) + ExecutionOriginDescription.GetHashCode();
                hashCode = (hashCode * 157) + ExecutionToken.GetHashCode();
                hashCode = (hashCode * 157) + AdditionalDetail.GetHashCode();
                hashCode = (hashCode * 157) + Environment.GetHashCode();
                hashCode = (hashCode * 157) + AuditDate.GetHashCode();

                return(hashCode);
            }
        }
Ejemplo n.º 3
0
 protected Event(EventCoordinator coordinator, InvocationOrigin invocationOrigin)
 {
     this.localId = coordinator.AllocateId();
     this.timestamp = coordinator.TimeNow();
     this.executionOrigin = coordinator.ExecutionOriginHere();
     this.invocationOrigin = invocationOrigin;
 }
Ejemplo n.º 4
0
        public void WriteXml(XmlWriter writer)
        {
            //------Always log these for reconstruction------------
            writer.WriteAttributeString("DisplayName", DisplayName);

            writer.WriteAttributeString("ID", ID.ToString());

            writer.WriteAttributeString("OriginalInstanceID", OriginalInstanceID.ToString());

            writer.WriteAttributeString("ParentID", ParentID.ToString());

            writer.WriteAttributeString("ServerID", ServerID.ToString());

            writer.WriteAttributeString("StateType", StateType.ToString());

            writer.WriteElementString("HasError", HasError.ToString());

            writer.WriteAttributeString("SessionID", SessionID.ToString());

            if (HasError)
            {
                writer.WriteElementString("ErrorMessage", ErrorMessage);
            }
            //-----------------------------

            var settings = WorkflowLoggger.LoggingSettings;

            //Version
            if (settings.IsVersionLogged && !string.IsNullOrWhiteSpace(Version))
            {
                writer.WriteElementString("Version", Version);
            }

            //Type
            if (settings.IsTypeLogged)
            {
                writer.WriteElementString("Name", Name);
                writer.WriteElementString("ActivityType", ActivityType.ToString());
            }

            //Duration
            if (settings.IsDurationLogged)
            {
                if (Duration != default(TimeSpan))
                {
                    writer.WriteElementString("Duration", DurationString);
                }
            }

            //DateTime
            if (settings.IsDataAndTimeLogged)
            {
                if (StartTime != DateTime.MinValue)
                {
                    writer.WriteElementString("StartTime", StartTime.ToString("G"));
                }
                if (EndTime != DateTime.MinValue)
                {
                    writer.WriteElementString("EndTime", EndTime.ToString("G"));
                }
            }


            //Input
            if (settings.IsInputLogged && Inputs.Count > 0)
            {
                writer.WriteStartElement("Inputs");
                writer.WriteAttributeString("Count", Inputs.Count.ToString(CultureInfo.InvariantCulture));

                var inputSer = new XmlSerializer(typeof(DebugItem));
                foreach (var other in Inputs)
                {
                    inputSer.Serialize(writer, other);
                }
                writer.WriteEndElement();
            }

            //Output
            if (settings.IsOutputLogged && Outputs.Count > 0)
            {
                writer.WriteStartElement("Outputs");
                writer.WriteAttributeString("Count", Outputs.Count.ToString(CultureInfo.InvariantCulture));

                var outputSer = new XmlSerializer(typeof(DebugItem));
                foreach (var other in Outputs)
                {
                    outputSer.Serialize(writer, other);
                }
                writer.WriteEndElement();
            }

            //StartBlock
            if (IsFirstStep())
            {
                if (ExecutionOrigin != ExecutionOrigin.Unknown)
                {
                    writer.WriteElementString("ExecutionOrigin", ExecutionOrigin.ToString());
                }
                if (!string.IsNullOrWhiteSpace(ExecutingUser))
                {
                    writer.WriteElementString("ExecutingUser", ExecutingUser);
                }
            }

            //EndBlock

            if (IsFinalStep())
            {
                writer.WriteElementString("NumberOfSteps", NumberOfSteps.ToString(CultureInfo.InvariantCulture));
            }
        }