Exemplo n.º 1
0
        private bool TrackActivityStateRecord(ActivityStateRecord activityRecord, ActualTrace _trace)
        {
            TestTraceManager.OptionalLogTrace("[InMemoryTrackingParticipant]activityRecord.Name = {0}", activityRecord.Activity.Name);
            ActivityTrace activityTrace = new ActivityTrace(
                activityRecord.Activity.Name,
                (ActivityInstanceState)Enum.Parse(typeof(ActivityInstanceState), activityRecord.State), activityRecord);

            //to avoid the confusion b\w Executing & scheduling events, we always use scheduled
            if (activityTrace.ActivityStatus != ActivityInstanceState.Executing)
            {
                _trace.Add(activityTrace);
                return(true);
            }

            //for tracking test cases, it may be the scenario that the profile does not have a scheduled record.
            //in that scenario, we need to add that explicitly to the trace.
            if (TestTraceManager.IsDefaultTrackingConfiguration == false)//is a tracking test case
            {
                if (
                    (_trace.Steps.Count == 0) ||
                    (
                        (_trace.Steps.Count != 0) &&
                        (_trace.Steps[_trace.Steps.Count - 1].Equals(activityTrace) == false)
                    )
                    )
                {
                    _trace.Add(activityTrace);
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        private void TrackWorkflowInstanceRecord(WorkflowInstanceRecord workflowInstanceRecord, ActualTrace _trace)
        {
            WorkflowInstanceState workflowInstanceState = (WorkflowInstanceState)Enum.Parse(typeof(WorkflowInstanceState), workflowInstanceRecord.State);
            WorkflowInstanceTrace workflowInstanceTrace = new WorkflowInstanceTrace(workflowInstanceRecord.InstanceId, workflowInstanceRecord.WorkflowDefinitionIdentity, workflowInstanceState);

            _trace.Add(workflowInstanceTrace);
        }
Exemplo n.º 3
0
 private void TrackActivityScheduledRecord(ActivityScheduledRecord activityScheduledRecord, ActualTrace _trace)
 {
     //the scheduling record simply states that i am scheduled blah. Currently we do not have any support in TO for this.
     //Hence, turning it off for now. we will have the tracking tests cover the validation.
     TestTraceManager.OptionalLogTrace("[InMemoryTrackingParticipant]activityScheduledRecord.TargetName = {0}", activityScheduledRecord.Child.Name);
     _trace.Add(new ActivityTrace(activityScheduledRecord.Child.Name,
                                  ActivityInstanceState.Executing, activityScheduledRecord));
 }
Exemplo n.º 4
0
        private void TrackBookmarkResumptionRecord(BookmarkResumptionRecord bookmarkResumptionRecord, ActualTrace _trace)
        {
            TestTraceManager.OptionalLogTrace("[InMemoryTrackingParticipant]BookmarkName = {0}, bookmarkResumptionRecord = {1} ", bookmarkResumptionRecord.BookmarkName, bookmarkResumptionRecord.ToString());
            _trace.Add(new BookmarkResumptionTrace(
                           bookmarkResumptionRecord.BookmarkName,
                           bookmarkResumptionRecord.BookmarkScope,
                           bookmarkResumptionRecord.Owner.Name));

            //_trace.Add(new ActivityTrace(bookmarkResumptionRecord.ToString(),
            //    ActivityInstanceState.Executing));
        }
Exemplo n.º 5
0
        public void AddTrace(Guid instanceId, IActualTraceStep trace)
        {
            if (trace == null)
            {
                throw new ArgumentNullException("trace");
            }

            //Log.TraceInternal("[TestTraceManager] " + instanceId + " - " + trace.ToString());

            lock (_thisLock)
            {
                ActualTrace instanceTraces = GetInstanceActualTrace(instanceId);
                instanceTraces.Add(trace);
                CheckSubscriptions(instanceId, instanceTraces);
            }
        }