public static void Trace(Guid instanceId, string message)
        {
            SynchronizeTrace synchronizeTrace = new SynchronizeTrace(instanceId, message);
            TraceSource      ts = new TraceSource("CoreWf.Tracking", SourceLevels.Information);

            ts.TraceData(TraceEventType.Information, 1, synchronizeTrace);
        }
예제 #2
0
        bool IActualTraceStep.Equals(IActualTraceStep trace)
        {
            SynchronizeTrace synchronizeTrace = trace as SynchronizeTrace;

            if (synchronizeTrace != null &&
                synchronizeTrace.userTrace.Message == this.userTrace.Message)
            {
                return(true);
            }

            return(false);
        }
예제 #3
0
        public override bool Equals(object obj)
        {
            SynchronizeTrace trace = obj as SynchronizeTrace;

            if (trace != null)
            {
                if (this.ToString() == trace.ToString())
                {
                    return(true);
                }
            }
            return(base.Equals(obj));
        }
예제 #4
0
        public ActualTrace(ActualTrace actualTrace)
        {
            lock (actualTrace.Steps)
            {
                foreach (IActualTraceStep step in actualTrace.Steps)
                {
                    ActivityTrace activityTrace = step as ActivityTrace;
                    if (activityTrace != null)
                    {
                        this.Steps.Add(new ActivityTrace(activityTrace));
                        continue;
                    }

                    //WorkflowInstanceUpdatedTrace workflowInstanceUpdatedTrace = step as WorkflowInstanceUpdatedTrace;
                    //if (workflowInstanceUpdatedTrace != null)
                    //{
                    //    this.Steps.Add(new WorkflowInstanceUpdatedTrace(workflowInstanceUpdatedTrace.InstanceName, workflowInstanceUpdatedTrace.OriginalWorkflowIdentity, workflowInstanceUpdatedTrace.WorkflowDefinitionIdentity, workflowInstanceUpdatedTrace.InstanceStatus));
                    //    continue;
                    //}

                    WorkflowInstanceTrace workflowInstanceTrace = step as WorkflowInstanceTrace;
                    if (workflowInstanceTrace != null)
                    {
                        this.Steps.Add(new WorkflowInstanceTrace(workflowInstanceTrace.InstanceName, workflowInstanceTrace.WorkflowDefinitionIdentity, workflowInstanceTrace.InstanceStatus));
                        continue;
                    }

                    UserTrace userTrace = step as UserTrace;
                    if (userTrace != null)
                    {
                        this.Steps.Add(new UserTrace(userTrace.InstanceId, userTrace.ActivityParent, userTrace.Message));
                        continue;
                    }

                    BookmarkResumptionTrace bookmarkResumptionTrace = step as BookmarkResumptionTrace;
                    if (bookmarkResumptionTrace != null)
                    {
                        this.Steps.Add(new BookmarkResumptionTrace(bookmarkResumptionTrace.BookmarkName, bookmarkResumptionTrace.SubinstanceId,
                                                                   bookmarkResumptionTrace.ActivityName));
                        continue;
                    }

                    SynchronizeTrace synchronizeTrace = step as SynchronizeTrace;
                    if (synchronizeTrace != null)
                    {
                        this.Steps.Add(new SynchronizeTrace(synchronizeTrace.userTrace.InstanceId,
                                                            synchronizeTrace.userTrace.Message));
                        continue;
                    }

                    WorkflowExceptionTrace weTrace = step as WorkflowExceptionTrace;
                    if (weTrace != null)
                    {
                        this.Steps.Add(new WorkflowExceptionTrace(weTrace.InstanceName, weTrace.InstanceException));
                        continue;
                    }

                    WorkflowAbortedTrace wasTrace = step as WorkflowAbortedTrace;
                    if (wasTrace != null)
                    {
                        this.Steps.Add(new WorkflowAbortedTrace(wasTrace.InstanceId, wasTrace.AbortedReason));
                        continue;
                    }
                }
            }
        }
 public static void Trace(Guid instanceId, string format, params object[] args)
 {
     SynchronizeTrace.Trace(instanceId, String.Format(format, args));
 }
예제 #6
0
        //makes a copy of the existing trace group
        public static TraceGroup GetNewTraceGroup(TraceGroup traceGroup)
        {
            TraceGroup newTraceGroup = null;

            if (traceGroup.ordered)
            {
                newTraceGroup = new OrderedTraces();
            }
            else
            {
                newTraceGroup = new UnorderedTraces();
            }

            foreach (WorkflowTraceStep step in traceGroup.Steps)
            {
                ActivityTrace activityTrace = step as ActivityTrace;
                if (activityTrace != null)
                {
                    newTraceGroup.Steps.Add(new ActivityTrace(activityTrace)
                    {
                        Optional = step.Optional
                    });

                    continue;
                }

                WorkflowInstanceTrace workflowInstanceTrace = step as WorkflowInstanceTrace;
                if (workflowInstanceTrace != null)
                {
                    newTraceGroup.Steps.Add(new WorkflowInstanceTrace(workflowInstanceTrace.InstanceName, workflowInstanceTrace.InstanceStatus)
                    {
                        Optional = step.Optional
                    });
                    continue;
                }

                UserTrace userTrace = step as UserTrace;
                if (userTrace != null)
                {
                    newTraceGroup.Steps.Add(new UserTrace(userTrace.InstanceId, userTrace.ActivityParent, userTrace.Message));
                    continue;
                }

                BookmarkResumptionTrace bookmarkResumptionTrace = step as BookmarkResumptionTrace;
                if (bookmarkResumptionTrace != null)
                {
                    newTraceGroup.Steps.Add(new BookmarkResumptionTrace(bookmarkResumptionTrace.BookmarkName,
                                                                        bookmarkResumptionTrace.SubinstanceId, bookmarkResumptionTrace.ActivityName));
                    continue;
                }

                SynchronizeTrace synchronizeTrace = step as SynchronizeTrace;
                if (synchronizeTrace != null)
                {
                    newTraceGroup.Steps.Add(new SynchronizeTrace(synchronizeTrace.userTrace.InstanceId,
                                                                 synchronizeTrace.userTrace.Message));
                    continue;
                }

                ActivityPlaceholderTrace activityPlaceholderTrace = step as ActivityPlaceholderTrace;
                if (activityPlaceholderTrace != null)
                {
                    newTraceGroup.Steps.Add(activityPlaceholderTrace);
                    continue;
                }

                TraceGroup tempTraceGroup = step as TraceGroup;
                if (tempTraceGroup != null)
                {
                    newTraceGroup.Steps.Add(TraceGroup.GetNewTraceGroup(tempTraceGroup));
                    continue;
                }
            }
            return(newTraceGroup);
        }