public LoggingEntryProperties(LoggingEntry entry) { InitializeComponent(); CloseCommand = new MethodCommand((command, o) => this.Close()); Entry = entry; this.DataContext = this; }
protected override void Track(TrackingRecord record, TimeSpan timeout) { LoggingEntry entry = null; var timeSpanValue = ExecutionTime?.GetTimeInfo(record); var commoninfo = $"{record.RecordNumber:00000} {timeSpanValue}"; if (IsSet(StateChangeRecords.ActivityState) && record is ActivityStateRecord) { var staterecord = (ActivityStateRecord) record; entry = new LoggingEntry($"{commoninfo} {record.GetType().Name} {staterecord.Activity.Name} ({staterecord.Activity.TypeName}) {staterecord.State}"); // add each variable/value to foreach (var valuePair in staterecord.Variables) { entry.AdditionalInformations.Add(new PropertyEntry() {Name = valuePair.Key, Value = valuePair.Value}); } } else if (IsSet(StateChangeRecords.ActivityScheduled) && record is ActivityScheduledRecord) { var scheduledrecord = (ActivityScheduledRecord) record; _writerAdapter.WriteLine($"{commoninfo} {scheduledrecord?.Activity?.Name} ({scheduledrecord?.Activity?.TypeName}) Child: {scheduledrecord.Child.Name}"); } else if (IsSet(StateChangeRecords.WorkflowInstance) && record is WorkflowInstanceRecord) { var instancerecord = (WorkflowInstanceRecord) record; _writerAdapter.WriteLine($"{commoninfo} State of workflow changed: {instancerecord.State}"); } else if (IsSet(StateChangeRecords.CancelRequested) && record is CancelRequestedRecord) { var cancelrecord = (CancelRequestedRecord) record; _writerAdapter.WriteLine($"{commoninfo} {record.GetType().Name} {cancelrecord.Activity?.Name}"); } else if (IsSet(StateChangeRecords.FaultPropagation) && record is FaultPropagationRecord) { var faultrecord = (FaultPropagationRecord) record; _writerAdapter.WriteLine($"{commoninfo} Fault {faultrecord?.Fault.Message}"); } if (record.Annotations.Any()) { Debug.WriteLine($"Anmerkungen bei {record.RecordNumber}"); } if (entry != null) { entry.Annotations.AddRange(record.Annotations.Values.ToList()); _writerAdapter.WriteEntry(entry); } }