예제 #1
0
        public GraywulfTrackingParticipant()
        {
            trackingProfile = new TrackingProfile();

            ActivityStateQuery aq = new ActivityStateQuery();

            aq.ActivityName = "*";
            aq.States.Add("*");
            aq.Arguments.Add("JobGuid");
            aq.Arguments.Add("UserGuid");
            aq.Arguments.Add("EntityGuid");
            aq.Arguments.Add("EntityGuidFrom");
            aq.Arguments.Add("EntityGuidTo");
            trackingProfile.Queries.Add(aq);

            CustomTrackingQuery cq = new CustomTrackingQuery();

            cq.ActivityName = "*";
            trackingProfile.Queries.Add(cq);

            FaultPropagationQuery fq = new FaultPropagationQuery();

            fq.FaultHandlerActivityName = "*";
            fq.FaultSourceActivityName  = "*";
            trackingProfile.Queries.Add(fq);
        }
예제 #2
0
        protected override TrackingQuery NewTrackingQuery()
        {
            FaultPropagationQuery query = new FaultPropagationQuery
            {
                FaultSourceActivityName  = this.FaultSourceActivityName,
                FaultHandlerActivityName = this.FaultHandlerActivityName
            };

            return(query);
        }
예제 #3
0
        private TrackingParticipant CreateActivityTrackingParticipant()
        {
            var trackingParticipant = new ActivityStackTraceParticipant(MaxActivityStackTraceCount)
            {
                TrackingSource  = _trackingSource,
                TrackingProfile = new TrackingProfile
                {
                    Name = "ActivitTrackingProfile",
                    ActivityDefinitionId = "ProcessOrder"
                }
            };

            //TrackingQuery query = new WorkflowInstanceQuery
            //{
            //    States = { "*" }
            //};
            //trackingParticipant.TrackingProfile.Queries.Add(query);

            TrackingQuery query = new ActivityStateQuery
            {
                States =
                {
                    //ActivityStates.Canceled,
                    //ActivityStates.Closed,
                    ActivityStates.Faulted,
                    ActivityStates.Executing
                }
            };

            trackingParticipant.TrackingProfile.Queries.Add(query);

            query = new FaultPropagationQuery();
            trackingParticipant.TrackingProfile.Queries.Add(query);

            query = new CustomTrackingQuery
            {
                ActivityName = "*",
                Name         = "*"
            };
            trackingParticipant.TrackingProfile.Queries.Add(query);

            return(trackingParticipant);
        }
예제 #4
0
        public override TrackingProfile GetActiveTrackingProfile()
        {
            //Log.TraceInternal("[CustomCodeProfileProvider]GetActiveTrackingProfile() ProfileType = {0}", this.ActiveTrackingProfile);
            TrackingProfile profile = new TrackingProfile
            {
                // Setting the visibility scope to All will retain the expected behaviour of old tests.
                ImplementationVisibility = ImplementationVisibility.All
            };
            WorkflowInstanceQuery   wfInstanceQuery         = new WorkflowInstanceQuery();
            ActivityStateQuery      activityStateQuery      = new ActivityStateQuery();
            ActivityScheduledQuery  activityScheduledQuery  = new ActivityScheduledQuery();
            BookmarkResumptionQuery bookmarkResumptionQuery = new BookmarkResumptionQuery();
            CustomTrackingQuery     customTrackingQuery     = new CustomTrackingQuery();
            CancelRequestedQuery    cancelRequestedQuery    = new CancelRequestedQuery();
            FaultPropagationQuery   faultPropagationQuery   = new FaultPropagationQuery();
            string all = "*";

            switch (this.ActiveTrackingProfile)
            {
            case TestProfileType.NullProfile:
                profile = null;
                break;

            case TestProfileType.UnavailableProfile:
                //add nothing
                break;

            case TestProfileType.NoProfile:
                //add nothing.
                break;

            case TestProfileType.EmptyProfile:
                //add nothing. simply return the empty profile object
                break;

            case TestProfileType.AllTrackpointsProfile:
                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);
                break;

            case TestProfileType.AllWfTrackpointsProfile:
                wfInstanceQuery.States.Add(WorkflowElementStates.Started);
                wfInstanceQuery.States.Add(WorkflowElementStates.Idle);
                wfInstanceQuery.States.Add(WorkflowElementStates.Closed);
                wfInstanceQuery.States.Add(WorkflowElementStates.Resumed);
                wfInstanceQuery.States.Add(WorkflowElementStates.Completed);
                profile.Queries.Add(wfInstanceQuery);
                break;

            case TestProfileType.ProfileScopeTarget:
                wfInstanceQuery.States.Add(WorkflowElementStates.Completed);
                profile.Queries.Add(wfInstanceQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Closed);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.DefaultITMonitoringProfile:
                wfInstanceQuery.States.Add(WorkflowElementStates.Started);
                profile.Queries.Add(wfInstanceQuery);

                //activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                //profile.Queries.Add(activityScheduledQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Executing);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.AllActivityTrackpointsProfile:
            case TestProfileType.ActivityTrackpointOnlyAllActivitiesAllStates:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.ActivityTrackpointOnlyAllActivities1State:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Completed);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.ActivityTrackpointOnlyAllActivities2States:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Completed);
                activityStateQuery.States.Add(WorkflowElementStates.Faulted);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.ActivityTrackpointsOnlyProfile:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);
                break;

            case TestProfileType.BookmarkTrackpointsOnlyProfile:
                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);
                break;

            case TestProfileType.WFInstanceTrackpointsOnlyProfile:
            case TestProfileType.WFInstanceTrackpointOnlyAllActivitiesAllState:
                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);
                break;

            case TestProfileType.WFInstanceTrackpointOnlyAllActivities1State:
                wfInstanceQuery.States.Add(WorkflowElementStates.Started);
                profile.Queries.Add(wfInstanceQuery);
                break;

            case TestProfileType.WFInstanceTrackpointOnlyAllActivities2State:
                wfInstanceQuery.States.Add(WorkflowElementStates.Started);
                wfInstanceQuery.States.Add(WorkflowElementStates.Completed);
                profile.Queries.Add(wfInstanceQuery);
                break;

            case TestProfileType.ActivityandBookmarkOnlyProfile:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(all);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);
                break;

            case TestProfileType.WFInstanceandBookmarkOnlyProfile:
                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);
                break;

            case TestProfileType.CustomWFEventsActivityCompletedOnly:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Closed);
                wfInstanceQuery.States.Add(WorkflowElementStates.Completed);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.CustomWFEventsActivityExecutingOnly:
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Executing);
                activityStateQuery.States.Add(WorkflowElementStates.Started);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.RandomProfile:
                profile.Queries.Add(wfInstanceQuery);
                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Executing);
                activityStateQuery.States.Add(WorkflowElementStates.Closed);
                profile.Queries.Add(activityStateQuery);
                break;

            case TestProfileType.MissingActivityNameProfile:

                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);

                break;

            case TestProfileType.FuzzedProfileStatus:

                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);
                break;

            case TestProfileType.FuzzedProfileStructure:

                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);
                break;

            case (TestProfileType.RandomFuzzedProfile欱欲欳欴欵欶欷欸欹欺欻欼欽款欿歀歁歂):

                wfInstanceQuery.States.Add(WorkflowElementStates.Completed);
                profile.Queries.Add(wfInstanceQuery);

                activityStateQuery.ActivityName = all;
                activityStateQuery.States.Add(WorkflowElementStates.Closed);
                profile.Queries.Add(activityStateQuery);

                activityScheduledQuery.ActivityName = activityScheduledQuery.ChildActivityName = all;
                profile.Queries.Add(activityScheduledQuery);

                cancelRequestedQuery.ActivityName = cancelRequestedQuery.ChildActivityName = all;
                profile.Queries.Add(cancelRequestedQuery);

                faultPropagationQuery.FaultHandlerActivityName = all;
                profile.Queries.Add(faultPropagationQuery);

                bookmarkResumptionQuery.Name = all;
                profile.Queries.Add(bookmarkResumptionQuery);

                customTrackingQuery.ActivityName = all;
                customTrackingQuery.Name         = all;
                profile.Queries.Add(customTrackingQuery);

                break;

            case TestProfileType.StateMachineTrackpointsOnly:
                wfInstanceQuery.States.Add(WorkflowElementStates.All);
                profile.Queries.Add(wfInstanceQuery);

                profile.Queries.Add(new StateMachineStateQuery()
                {
                    ActivityName = all
                });
                break;

            default:
                //Log.TraceInternal("[CustomCodeProfileProvider]Returning default null profile...");
                profile = null;
                break;
            }

            return(profile);
        }