Esempio n. 1
0
        public TrackingCommand(TrackingRecord record)
            : this()
        {
            ActivityScheduledRecord activityScheduledRecord = record as ActivityScheduledRecord;

            if (activityScheduledRecord != null)
            {
                CreateTrackingCommand(activityScheduledRecord);
                return;
            }

            CancelRequestedRecord cancelRequestedRecord = record as CancelRequestedRecord;

            if (cancelRequestedRecord != null)
            {
                CreateTrackingCommand(cancelRequestedRecord);
                return;
            }

            FaultPropagationRecord faultPropagationRecord = record as FaultPropagationRecord;

            if (faultPropagationRecord != null)
            {
                CreateTrackingCommand(faultPropagationRecord);
                return;
            }


            ActivityStateRecord activityStateRecord = record as ActivityStateRecord;

            if (activityStateRecord != null)
            {
                CreateTrackingCommand(activityStateRecord);
                return;
            }

            WorkflowInstanceRecord workflowInstanceRecord = record as WorkflowInstanceRecord;

            if (workflowInstanceRecord != null)
            {
                CreateTrackingCommand(workflowInstanceRecord);
                return;
            }

            BookmarkResumptionRecord bookmarkResumptionRecord = record as BookmarkResumptionRecord;

            if (bookmarkResumptionRecord != null)
            {
                CreateTrackingCommand(bookmarkResumptionRecord);
                return;
            }

            CustomTrackingRecord customTrackingRecord = record as CustomTrackingRecord;

            if (customTrackingRecord != null)
            {
                CreateTrackingCommand(customTrackingRecord);
                return;
            }
        }
        private void TrackCancelRequestedRecord(CancelRequestedRecord cancelRecord, ActualTrace _trace)
        {
            TestTraceManager.OptionalLogTrace("[InMemoryTrackingParticipant]cancelRequestedRecord.TargetName = {0}", cancelRecord.Child.Name);

            //this gets propogated twice by the product: ActivityStates.Fault information.
            {
                // WFCore - AT LEAST the DoWhile test cases that Cancel were failing because of these "extra"
                // Activity Canceled records in the trace. It's not clear if this is the right thing to do.
                //_trace.Add(new ActivityTrace(
                //    cancelRecord.Child.Name,
                //    (ActivityInstanceState)Enum.Parse(typeof(ActivityInstanceState), ActivityStates.Canceled)));
            }
        }
 private void TrackCancelRequestedRecord(CancelRequestedRecord cancelRecord)
 {
     if (WfEtwTrackingEventSource.Instance.CancelRequestedRecordIsEnabled())
     {
         WfEtwTrackingEventSource.Instance.CancelRequestedRecord(cancelRecord.InstanceId,
                                                                 cancelRecord.RecordNumber,
                                                                 cancelRecord.EventTime,
                                                                 cancelRecord.Activity == null ? string.Empty : cancelRecord.Activity.Name,
                                                                 cancelRecord.Activity == null ? string.Empty : cancelRecord.Activity.Id,
                                                                 cancelRecord.Activity == null ? string.Empty : cancelRecord.Activity.InstanceId,
                                                                 cancelRecord.Activity == null ? string.Empty : cancelRecord.Activity.TypeName,
                                                                 cancelRecord.Child.Name, cancelRecord.Child.Id, cancelRecord.Child.InstanceId, cancelRecord.Child.TypeName,
                                                                 cancelRecord.HasAnnotations ? JsonConvert.SerializeObject(cancelRecord.Annotations, Formatting.Indented) : emptyItemsTag,
                                                                 this.TrackingProfile == null ? string.Empty : this.TrackingProfile.Name, this.ApplicationReference);
     }
 }
Esempio n. 4
0
        void CreateTrackingCommand(CancelRequestedRecord record)
        {
            this.Procedure = "[MOJ.WorkflowManger.Tracking].[InsertActivityCancelRequestedEvent]";

            this.parameters.Add(CreateTrackingCommandParameter("@WorkflowInstanceId", SqlDbType.UniqueIdentifier, null, record.InstanceId));
            this.parameters.Add(CreateTrackingCommandParameter("@RecordNumber", SqlDbType.BigInt, null, record.RecordNumber));
            this.parameters.Add(CreateTrackingCommandParameter("@TraceLevelId", SqlDbType.TinyInt, null, record.Level));
            this.parameters.Add(CreateTrackingCommandParameter("@ActivityRecordType", SqlDbType.NVarChar, 128, "ActivityScheduled"));
            this.parameters.Add(CreateTrackingCommandParameter("@ActivityName", SqlDbType.NVarChar, 1024, record.Activity == null ? string.Empty : record.Activity.Name));
            this.parameters.Add(CreateTrackingCommandParameter("@ActivityId", SqlDbType.NVarChar, 256, record.Activity == null ? string.Empty : record.Activity.Id));
            this.parameters.Add(CreateTrackingCommandParameter("@ActivityInstanceId", SqlDbType.NVarChar, 256, record.Activity == null ? string.Empty : record.Activity.InstanceId));
            this.parameters.Add(CreateTrackingCommandParameter("@ActivityType", SqlDbType.NVarChar, 2048, record.Activity == null ? string.Empty : record.Activity.TypeName));
            this.parameters.Add(CreateTrackingCommandParameter("@ChildActivityName", SqlDbType.NVarChar, 1024, record.Child.Name));
            this.parameters.Add(CreateTrackingCommandParameter("@ChildActivityId", SqlDbType.NVarChar, 256, record.Child.Id));
            this.parameters.Add(CreateTrackingCommandParameter("@ChildActivityInstanceId", SqlDbType.NVarChar, 256, record.Child.InstanceId));
            this.parameters.Add(CreateTrackingCommandParameter("@ChildActivityType", SqlDbType.NVarChar, 2048, record.Child.TypeName));
            this.parameters.Add(CreateTrackingCommandParameter("@AnnotationsXml", SqlDbType.NVarChar, null, this.SerializeData(record.Annotations)));
            this.parameters.Add(CreateTrackingCommandParameter("@TimeCreated", SqlDbType.DateTime, null, record.EventTime));
        }
Esempio n. 5
0
        private void LogCancelRequestedRecord(CancelRequestedRecord record)
        {
            Contract.Requires(null != record);

            var annotations = JsonConvert.SerializeObject(record.Annotations, Formatting.Indented);
            var activity    = JsonConvert.SerializeObject(record.Activity, Formatting.Indented);
            var child       = JsonConvert.SerializeObject(record.Child, Formatting.Indented);

            Logger.Get(_loggingTrackingParticipantSettings.TraceSourceName)
            .TraceInformation("{0} {1} {2} - InstanceId = '{3}', Annotations = '{4}', Activity = '{5}', Child = '{6}'",
                              record.GetType().Name,
                              record.EventTime,
                              record.Level,
                              record.InstanceId,
                              annotations,
                              activity,
                              child
                              );
        }