Ejemplo n.º 1
0
		private void ProcessWorkflowInstanceRecord(WorkflowInstanceRecord record)
		{
			object[] instanceId = new object[2];
			instanceId[0] = record.InstanceId;
			instanceId[1] = record.State;
			this.Tracer.WriteMessage(string.Format(CultureInfo.InvariantCulture, " Workflow InstanceID: {0} Workflow instance state: {1}", instanceId));
		}
 protected WorkflowInstanceRecord(WorkflowInstanceRecord record)
     : base(record)
 {
     this.ActivityDefinitionId = record.ActivityDefinitionId;
     this.State = record.State;
     this.WorkflowDefinitionIdentity = record.WorkflowDefinitionIdentity;
 }
 protected WorkflowInstanceRecord(WorkflowInstanceRecord record)
     : base(record)
 {
     this.ActivityDefinitionId = record.ActivityDefinitionId;
     this.State = record.State;
     this.WorkflowDefinitionIdentity = record.WorkflowDefinitionIdentity;
 }
        private WorkflowInstanceQuery Match(WorkflowInstanceRecord workflowRecord)
        {
            WorkflowInstanceQuery query = null;

            if ((this.workflowEventSubscriptions != null) && !this.workflowEventSubscriptions.TryGetValue(workflowRecord.State, out query))
            {
                this.workflowEventSubscriptions.TryGetValue("*", out query);
            }
            return(query);
        }
Ejemplo n.º 5
0
        private WorkflowInstanceQuery Match(WorkflowInstanceRecord workflowRecord)
        {
            WorkflowInstanceQuery trackingQuery = null;

            if (this.workflowEventSubscriptions != null)
            {
                if (!this.workflowEventSubscriptions.TryGetValue(workflowRecord.State, out trackingQuery))
                {
                    this.workflowEventSubscriptions.TryGetValue("*", out trackingQuery);
                }
            }
            return(trackingQuery);
        }
 private void TrackWorkflowRecord(WorkflowInstanceRecord record)
 {
     if (record is WorkflowInstanceUnhandledExceptionRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceUnhandledExceptionRecord record2 = record as WorkflowInstanceUnhandledExceptionRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecord(this.diagnosticTrace, record2.InstanceId, record2.RecordNumber, record2.EventTime.ToFileTime(), record2.ActivityDefinitionId, record2.FaultSource.Name, record2.FaultSource.Id, record2.FaultSource.InstanceId, record2.FaultSource.TypeName, (record2.UnhandledException == null) ? string.Empty : record2.UnhandledException.ToString(), record2.HasAnnotations ? PrepareAnnotations(record2.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecord(this.diagnosticTrace, record2.InstanceId, record2.RecordNumber, record2.EventTime.ToFileTime(), record2.ActivityDefinitionId, record2.FaultSource.Name, record2.FaultSource.Id, record2.FaultSource.InstanceId, record2.FaultSource.TypeName, (record2.UnhandledException == null) ? string.Empty : record2.UnhandledException.ToString(), "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record2.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record2.RecordNumber);
                 }
             }
         }
     }
     else if (record is WorkflowInstanceAbortedRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceAbortedRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceAbortedRecord record3 = record as WorkflowInstanceAbortedRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceAbortedRecord(this.diagnosticTrace, record3.InstanceId, record3.RecordNumber, record3.EventTime.ToFileTime(), record3.ActivityDefinitionId, record3.Reason, record3.HasAnnotations ? PrepareAnnotations(record3.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceAbortedRecord(this.diagnosticTrace, record3.InstanceId, record3.RecordNumber, record3.EventTime.ToFileTime(), record3.ActivityDefinitionId, record3.Reason, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record3.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record3.RecordNumber);
                 }
             }
         }
     }
     else if (record is WorkflowInstanceSuspendedRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceSuspendedRecord record4 = record as WorkflowInstanceSuspendedRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecord(this.diagnosticTrace, record4.InstanceId, record4.RecordNumber, record4.EventTime.ToFileTime(), record4.ActivityDefinitionId, record4.Reason, record4.HasAnnotations ? PrepareAnnotations(record4.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecord(this.diagnosticTrace, record4.InstanceId, record4.RecordNumber, record4.EventTime.ToFileTime(), record4.ActivityDefinitionId, record4.Reason, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record4.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record4.RecordNumber);
                 }
             }
         }
     }
     else if (record is WorkflowInstanceTerminatedRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceTerminatedRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceTerminatedRecord record5 = record as WorkflowInstanceTerminatedRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceTerminatedRecord(this.diagnosticTrace, record5.InstanceId, record5.RecordNumber, record5.EventTime.ToFileTime(), record5.ActivityDefinitionId, record5.Reason, record5.HasAnnotations ? PrepareAnnotations(record5.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceTerminatedRecord(this.diagnosticTrace, record5.InstanceId, record5.RecordNumber, record5.EventTime.ToFileTime(), record5.ActivityDefinitionId, record5.Reason, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record5.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record5.RecordNumber);
                 }
             }
         }
     }
     else if (EtwTrackingParticipantTrackRecords.WorkflowInstanceRecordIsEnabled(this.diagnosticTrace) && !EtwTrackingParticipantTrackRecords.WorkflowInstanceRecord(this.diagnosticTrace, record.InstanceId, record.RecordNumber, record.EventTime.ToFileTime(), record.ActivityDefinitionId, record.State, record.HasAnnotations ? PrepareAnnotations(record.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceRecord(this.diagnosticTrace, record.InstanceId, record.RecordNumber, record.EventTime.ToFileTime(), record.ActivityDefinitionId, record.State, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
         {
             this.TraceTrackingRecordTruncated(record.RecordNumber);
         }
         else
         {
             this.TraceTrackingRecordDropped(record.RecordNumber);
         }
     }
 }
 void TrackWorkflowInstanceUpdatedRecord(WorkflowInstanceRecord record)
 {
     if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUpdatedRecordIsEnabled(this.diagnosticTrace))
     {
         WorkflowInstanceUpdatedRecord updatedRecord = record as WorkflowInstanceUpdatedRecord;
         if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceUpdatedRecord(this.diagnosticTrace, updatedRecord.EventTraceActivity, updatedRecord.InstanceId,
             updatedRecord.RecordNumber, updatedRecord.EventTime.ToFileTime(), updatedRecord.ActivityDefinitionId, updatedRecord.State,
             updatedRecord.OriginalDefinitionIdentity == null ? string.Empty : updatedRecord.OriginalDefinitionIdentity.ToString(),
             updatedRecord.WorkflowDefinitionIdentity == null ? string.Empty : updatedRecord.WorkflowDefinitionIdentity.ToString(),
             updatedRecord.HasAnnotations ? PrepareAnnotations(updatedRecord.Annotations) : emptyItemsTag,
             this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
         {
             if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUpdatedRecord(this.diagnosticTrace, updatedRecord.EventTraceActivity, updatedRecord.InstanceId,
                 updatedRecord.RecordNumber, updatedRecord.EventTime.ToFileTime(), updatedRecord.ActivityDefinitionId, updatedRecord.State,
                 updatedRecord.OriginalDefinitionIdentity == null ? string.Empty : updatedRecord.OriginalDefinitionIdentity.ToString(),
                 updatedRecord.WorkflowDefinitionIdentity == null ? string.Empty : updatedRecord.WorkflowDefinitionIdentity.ToString(),
                 updatedRecord.HasAnnotations ? PrepareAnnotations(updatedRecord.Annotations) : emptyItemsTag,
                 this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 TraceTrackingRecordTruncated(updatedRecord.RecordNumber);
             }
             else
             {
                 TraceTrackingRecordDropped(updatedRecord.RecordNumber);
             }
         }
     }
 }
 protected override void OnWorkflowInstance(WorkflowInstanceRecord record, TimeSpan timeout)
 {            
     Log.InfoWrite("Tracking::WorkflowInstance - Id:{0}, InstanceId:{1}, EventTime:{2}, Record#:{3}, Level:{4}, State:{5}", record.ActivityDefinitionId, record.InstanceId, record.EventTime, record.RecordNumber, record.Level, record.State);
 }
 void TrackWorkflowInstanceUnhandledExceptionRecord(WorkflowInstanceRecord record)
 {
     WorkflowInstanceUnhandledExceptionRecord unhandled = record as WorkflowInstanceUnhandledExceptionRecord;
     if (unhandled.WorkflowDefinitionIdentity == null)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecordIsEnabled(this.diagnosticTrace))
         {
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecord(this.diagnosticTrace, unhandled.EventTraceActivity, unhandled.InstanceId,
                 unhandled.RecordNumber, unhandled.EventTime.ToFileTime(), unhandled.ActivityDefinitionId,
                 unhandled.FaultSource.Name, unhandled.FaultSource.Id, unhandled.FaultSource.InstanceId, unhandled.FaultSource.TypeName,
                 unhandled.UnhandledException == null ? string.Empty : unhandled.UnhandledException.ToString(),
                 unhandled.HasAnnotations ? PrepareAnnotations(unhandled.Annotations) : emptyItemsTag,
                 this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecord(this.diagnosticTrace, unhandled.EventTraceActivity, unhandled.InstanceId,
                     unhandled.RecordNumber, unhandled.EventTime.ToFileTime(), unhandled.ActivityDefinitionId,
                     unhandled.FaultSource.Name, unhandled.FaultSource.Id, unhandled.FaultSource.InstanceId, unhandled.FaultSource.TypeName,
                     unhandled.UnhandledException == null ? string.Empty : unhandled.UnhandledException.ToString(),
                     truncatedItemsTag, this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     TraceTrackingRecordTruncated(unhandled.RecordNumber);
                 }                        
                 else
                 {
                     TraceTrackingRecordDropped(unhandled.RecordNumber);
                 }
             }
         }
     }
     else
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecordWithIdIsEnabled(this.diagnosticTrace))
         {
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecordWithId(this.diagnosticTrace, unhandled.EventTraceActivity, unhandled.InstanceId,
                 unhandled.RecordNumber, unhandled.EventTime.ToFileTime(), unhandled.ActivityDefinitionId,
                 unhandled.FaultSource.Name, unhandled.FaultSource.Id, unhandled.FaultSource.InstanceId, unhandled.FaultSource.TypeName,
                 unhandled.UnhandledException == null ? string.Empty : unhandled.UnhandledException.ToString(),
                 unhandled.HasAnnotations ? PrepareAnnotations(unhandled.Annotations) : emptyItemsTag,
                 this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name == null ? string.Empty : this.TrackingProfile.Name,
                 unhandled.WorkflowDefinitionIdentity.ToString(), this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecordWithId(this.diagnosticTrace, unhandled.EventTraceActivity, unhandled.InstanceId,
                     unhandled.RecordNumber, unhandled.EventTime.ToFileTime(), unhandled.ActivityDefinitionId,
                     unhandled.FaultSource.Name, unhandled.FaultSource.Id, unhandled.FaultSource.InstanceId, unhandled.FaultSource.TypeName,
                     unhandled.UnhandledException == null ? string.Empty : unhandled.UnhandledException.ToString(),
                     truncatedItemsTag, this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name == null ? string.Empty : this.TrackingProfile.Name,
                     unhandled.WorkflowDefinitionIdentity.ToString(), this.ApplicationReference))
                 {
                     TraceTrackingRecordTruncated(unhandled.RecordNumber);
                 }
                 else
                 {
                     TraceTrackingRecordDropped(unhandled.RecordNumber);
                 }
             }
         }
     }
 }
 void TrackWorkflowInstanceSuspendedRecord(WorkflowInstanceRecord record)
 {
     WorkflowInstanceSuspendedRecord suspended = record as WorkflowInstanceSuspendedRecord;
     if (suspended.WorkflowDefinitionIdentity == null)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecordIsEnabled(this.diagnosticTrace))
         {
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecord(this.diagnosticTrace, suspended.EventTraceActivity, suspended.InstanceId, suspended.RecordNumber,
                 suspended.EventTime.ToFileTime(), suspended.ActivityDefinitionId, suspended.Reason,
                 suspended.HasAnnotations ? PrepareAnnotations(suspended.Annotations) : emptyItemsTag,
                 this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecord(this.diagnosticTrace, suspended.EventTraceActivity, suspended.InstanceId, suspended.RecordNumber,
                     suspended.EventTime.ToFileTime(), suspended.ActivityDefinitionId, suspended.Reason,
                     truncatedItemsTag, this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     TraceTrackingRecordTruncated(suspended.RecordNumber);
                 }
                 else
                 {
                     TraceTrackingRecordDropped(suspended.RecordNumber);
                 }
             }
         }
     }
     else
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecordWithIdIsEnabled(this.diagnosticTrace))
         {
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecordWithId(this.diagnosticTrace, suspended.EventTraceActivity, suspended.InstanceId, suspended.RecordNumber,
                 suspended.EventTime.ToFileTime(), suspended.ActivityDefinitionId, suspended.Reason,
                 suspended.HasAnnotations ? PrepareAnnotations(suspended.Annotations) : emptyItemsTag,
                 this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name == null ? string.Empty : this.TrackingProfile.Name,
                 suspended.WorkflowDefinitionIdentity.ToString(), this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecordWithId(this.diagnosticTrace, suspended.EventTraceActivity, suspended.InstanceId, suspended.RecordNumber,
                     suspended.EventTime.ToFileTime(), suspended.ActivityDefinitionId, suspended.Reason,
                     truncatedItemsTag, this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name == null ? string.Empty : this.TrackingProfile.Name,
                     suspended.WorkflowDefinitionIdentity.ToString(), this.ApplicationReference))
                 {
                     TraceTrackingRecordTruncated(suspended.RecordNumber);
                 }
                 else
                 {
                     TraceTrackingRecordDropped(suspended.RecordNumber);
                 }
             }
         }
     }
 }
 private WorkflowInstanceQuery Match(WorkflowInstanceRecord workflowRecord)
 {
     WorkflowInstanceQuery query = null;
     if ((this.workflowEventSubscriptions != null) && !this.workflowEventSubscriptions.TryGetValue(workflowRecord.State, out query))
     {
         this.workflowEventSubscriptions.TryGetValue("*", out query);
     }
     return query;
 }
 void TrackWorkflowRecord(WorkflowInstanceRecord record)
 {
     // In the TrackWorkflowInstance*Record methods below there are two code paths.
     // If the WorkflowIdentity is null, then we follow the exisiting 4.0 path.
     // If the WorkflowIdentity is provided, then if a particular field in the workflowInstance 
     // record is null, we need to ensure that we are passing string.Empty.
     // The WriteEvent method on the DiagnosticEventProvider which is called in the 
     // WriteEtwEvent in the EtwTrackingParticipantRecords class invokes the EventWrite
     // native method which relies on getting the record arguments in a particular order.
     if (record is WorkflowInstanceUnhandledExceptionRecord)
     {
         TrackWorkflowInstanceUnhandledExceptionRecord(record);
     }
     else if (record is WorkflowInstanceAbortedRecord)
     {
         TrackWorkflowInstanceAbortedRecord(record);                
     }
     else if (record is WorkflowInstanceSuspendedRecord)
     {
         TrackWorkflowInstanceSuspendedRecord(record);                
     }
     else if (record is WorkflowInstanceTerminatedRecord)
     {
         TrackWorkflowInstanceTerminatedRecord(record);                
     }
     else if (record is WorkflowInstanceUpdatedRecord)
     {
         TrackWorkflowInstanceUpdatedRecord(record);
     }
     else
     {
         TrackWorkflowInstanceRecord(record);
     }
 }
 protected virtual void OnWorkflowInstance(WorkflowInstanceRecord record, TimeSpan timeout) { }
Ejemplo n.º 14
0
		protected WorkflowInstanceRecord (WorkflowInstanceRecord record)
			: base (record)
		{
		}
 WorkflowInstanceQuery Match(WorkflowInstanceRecord workflowRecord)
 {
     WorkflowInstanceQuery trackingQuery = null;
     if (this.workflowEventSubscriptions != null)
     {
         if (!this.workflowEventSubscriptions.TryGetValue(workflowRecord.State, out trackingQuery))
         {
             this.workflowEventSubscriptions.TryGetValue("*", out trackingQuery);
         }
     }
     return trackingQuery;
 }
			public void Track (WorkflowInstanceRecord instanceRecord)
			{
				throw new NotImplementedException ();
			}
Ejemplo n.º 17
0
 protected WorkflowInstanceRecord(WorkflowInstanceRecord record)
     : base(record)
 {
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Process the workflow instance record.
 /// </summary>
 /// <param name="record">Record representing workflow instance record.</param>
 private void ProcessWorkflowInstanceRecord(WorkflowInstanceRecord record)
 {
     Tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture, " Workflow InstanceID: {0} Workflow instance state: {1}", record.InstanceId, record.State));
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Process the tracking record and update instance status.
        /// </summary>
        /// <param name="instanceRecord">The instance record.</param>
        private void OnWorkflowInstanceRecord(WorkflowInstanceRecord instanceRecord)
        {
            IChannelInstance channelInstance;
            _instances.TryGetValue(instanceRecord.InstanceId, out channelInstance);

            switch (instanceRecord.State)
            {
                case "Started":
                    if (channelInstance == null)
                    {
                        channelInstance = new ChannelInstance(this, instanceRecord.InstanceId);
                        _instances.TryAdd(instanceRecord.InstanceId, channelInstance);
                    }

                    channelInstance.State = instanceRecord.State;
                    break;

                case "Idle":
                    if (channelInstance == null)
                        return;
                    channelInstance.State = channelInstance.Pipelines.Any(p => !p.IsCompleted)
                        ? "Processing"
                        : instanceRecord.State;
                    break;

                case "Completed":
                case "Canceled":
                    if (channelInstance == null)
                        return;
                    channelInstance.State = instanceRecord.State;
                    channelInstance.CompletedAt = DateTimeOffset.Now;
                    channelInstance.IsCompleted = true;
                    break;

                case "Deleted":
                    if (channelInstance == null)
                        return;
                    // TODO: Schedule archive/removal
                    channelInstance.IsDeleted = true;
                    break;
            }

            // Publish the updated instance
            ChannelBus.Publish(channelInstance);
        }
 private void TrackWorkflowRecord(WorkflowInstanceRecord record)
 {
     if (record is WorkflowInstanceUnhandledExceptionRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceUnhandledExceptionRecord record2 = record as WorkflowInstanceUnhandledExceptionRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecord(this.diagnosticTrace, record2.InstanceId, record2.RecordNumber, record2.EventTime.ToFileTime(), record2.ActivityDefinitionId, record2.FaultSource.Name, record2.FaultSource.Id, record2.FaultSource.InstanceId, record2.FaultSource.TypeName, (record2.UnhandledException == null) ? string.Empty : record2.UnhandledException.ToString(), record2.HasAnnotations ? PrepareAnnotations(record2.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceUnhandledExceptionRecord(this.diagnosticTrace, record2.InstanceId, record2.RecordNumber, record2.EventTime.ToFileTime(), record2.ActivityDefinitionId, record2.FaultSource.Name, record2.FaultSource.Id, record2.FaultSource.InstanceId, record2.FaultSource.TypeName, (record2.UnhandledException == null) ? string.Empty : record2.UnhandledException.ToString(), "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record2.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record2.RecordNumber);
                 }
             }
         }
     }
     else if (record is WorkflowInstanceAbortedRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceAbortedRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceAbortedRecord record3 = record as WorkflowInstanceAbortedRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceAbortedRecord(this.diagnosticTrace, record3.InstanceId, record3.RecordNumber, record3.EventTime.ToFileTime(), record3.ActivityDefinitionId, record3.Reason, record3.HasAnnotations ? PrepareAnnotations(record3.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceAbortedRecord(this.diagnosticTrace, record3.InstanceId, record3.RecordNumber, record3.EventTime.ToFileTime(), record3.ActivityDefinitionId, record3.Reason, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record3.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record3.RecordNumber);
                 }
             }
         }
     }
     else if (record is WorkflowInstanceSuspendedRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceSuspendedRecord record4 = record as WorkflowInstanceSuspendedRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecord(this.diagnosticTrace, record4.InstanceId, record4.RecordNumber, record4.EventTime.ToFileTime(), record4.ActivityDefinitionId, record4.Reason, record4.HasAnnotations ? PrepareAnnotations(record4.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceSuspendedRecord(this.diagnosticTrace, record4.InstanceId, record4.RecordNumber, record4.EventTime.ToFileTime(), record4.ActivityDefinitionId, record4.Reason, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record4.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record4.RecordNumber);
                 }
             }
         }
     }
     else if (record is WorkflowInstanceTerminatedRecord)
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceTerminatedRecordIsEnabled(this.diagnosticTrace))
         {
             WorkflowInstanceTerminatedRecord record5 = record as WorkflowInstanceTerminatedRecord;
             if (!EtwTrackingParticipantTrackRecords.WorkflowInstanceTerminatedRecord(this.diagnosticTrace, record5.InstanceId, record5.RecordNumber, record5.EventTime.ToFileTime(), record5.ActivityDefinitionId, record5.Reason, record5.HasAnnotations ? PrepareAnnotations(record5.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
             {
                 if (EtwTrackingParticipantTrackRecords.WorkflowInstanceTerminatedRecord(this.diagnosticTrace, record5.InstanceId, record5.RecordNumber, record5.EventTime.ToFileTime(), record5.ActivityDefinitionId, record5.Reason, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
                 {
                     this.TraceTrackingRecordTruncated(record5.RecordNumber);
                 }
                 else
                 {
                     this.TraceTrackingRecordDropped(record5.RecordNumber);
                 }
             }
         }
     }
     else if (EtwTrackingParticipantTrackRecords.WorkflowInstanceRecordIsEnabled(this.diagnosticTrace) && !EtwTrackingParticipantTrackRecords.WorkflowInstanceRecord(this.diagnosticTrace, record.InstanceId, record.RecordNumber, record.EventTime.ToFileTime(), record.ActivityDefinitionId, record.State, record.HasAnnotations ? PrepareAnnotations(record.Annotations) : "<items />", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
     {
         if (EtwTrackingParticipantTrackRecords.WorkflowInstanceRecord(this.diagnosticTrace, record.InstanceId, record.RecordNumber, record.EventTime.ToFileTime(), record.ActivityDefinitionId, record.State, "<items>...</items>", (this.TrackingProfile == null) ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference))
         {
             this.TraceTrackingRecordTruncated(record.RecordNumber);
         }
         else
         {
             this.TraceTrackingRecordDropped(record.RecordNumber);
         }
     }
 }
 /// <summary>
 /// When implemented in a derived class, used to synchronously process the tracking record.
 /// </summary>
 /// <param name="record">
 /// The generated tracking record. 
 /// </param>
 /// <param name="timeout">
 /// The time period after which the provider aborts the attempt. 
 /// </param>
 protected virtual void Track(WorkflowInstanceRecord record, TimeSpan timeout)
 {
     // Do nothing
 }