protected override TrackingQuery NewTrackingQuery() { WorkflowInstanceQuery query = new WorkflowInstanceQuery(); foreach (StateElement element in this.States) { query.States.Add(element.Name); } return query; }
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); }
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 AddWorkflowSubscription(WorkflowInstanceQuery workflowTrackingQuery) { this.trackingRecordPreFilter.TrackWorkflowInstanceRecords = true; if (this.workflowEventSubscriptions == null) { this.workflowEventSubscriptions = new Dictionary <string, WorkflowInstanceQuery>(); } if (workflowTrackingQuery.HasStates) { foreach (string str in workflowTrackingQuery.States) { if (!this.workflowEventSubscriptions.ContainsKey(str)) { this.workflowEventSubscriptions.Add(str, workflowTrackingQuery); } } } }
private void AddWorkflowSubscription(WorkflowInstanceQuery workflowTrackingQuery) { this.trackingRecordPreFilter.TrackWorkflowInstanceRecords = true; if (this.workflowEventSubscriptions == null) { this.workflowEventSubscriptions = new Dictionary <string, WorkflowInstanceQuery>(); } if (workflowTrackingQuery.HasStates) { foreach (var state in workflowTrackingQuery.States) { //if duplicates are found, use only the first subscription for a given state. if (!this.workflowEventSubscriptions.ContainsKey(state)) { this.workflowEventSubscriptions.Add(state, workflowTrackingQuery); } } } }
private void AddWorkflowSubscription(WorkflowInstanceQuery workflowTrackingQuery) { this.trackingRecordPreFilter.TrackWorkflowInstanceRecords = true; if (this.workflowEventSubscriptions == null) { this.workflowEventSubscriptions = new Dictionary<string, WorkflowInstanceQuery>(); } if (workflowTrackingQuery.HasStates) { foreach (string str in workflowTrackingQuery.States) { if (!this.workflowEventSubscriptions.ContainsKey(str)) { this.workflowEventSubscriptions.Add(str, workflowTrackingQuery); } } } }
private PSWorkflowTrackingParticipant GetTrackingParticipant() { PSWorkflowTrackingParticipant pSWorkflowTrackingParticipant = new PSWorkflowTrackingParticipant(); TrackingProfile trackingProfile = new TrackingProfile(); trackingProfile.Name = "WorkflowTrackingProfile"; CustomTrackingQuery customTrackingQuery = new CustomTrackingQuery(); customTrackingQuery.Name = "*"; customTrackingQuery.ActivityName = "*"; trackingProfile.Queries.Add(customTrackingQuery); WorkflowInstanceQuery workflowInstanceQuery = new WorkflowInstanceQuery(); workflowInstanceQuery.States.Add("Started"); workflowInstanceQuery.States.Add("Completed"); workflowInstanceQuery.States.Add("Persisted"); workflowInstanceQuery.States.Add("UnhandledException"); trackingProfile.Queries.Add(workflowInstanceQuery); ActivityStateQuery activityStateQuery = new ActivityStateQuery(); activityStateQuery.ActivityName = "*"; activityStateQuery.States.Add("*"); activityStateQuery.Variables.Add("*"); trackingProfile.Queries.Add(activityStateQuery); pSWorkflowTrackingParticipant.TrackingProfile = trackingProfile; PSWorkflowTrackingParticipant pSWorkflowTrackingParticipant1 = pSWorkflowTrackingParticipant; return pSWorkflowTrackingParticipant1; }
void AddWorkflowSubscription(WorkflowInstanceQuery workflowTrackingQuery) { this.trackingRecordPreFilter.TrackWorkflowInstanceRecords = true; if (this.workflowEventSubscriptions == null) { this.workflowEventSubscriptions = new Dictionary<string, WorkflowInstanceQuery>(); } if (workflowTrackingQuery.HasStates) { foreach (string state in workflowTrackingQuery.States) { //if duplicates are found, use only the first subscription for a given state. if (!this.workflowEventSubscriptions.ContainsKey(state)) { this.workflowEventSubscriptions.Add(state, workflowTrackingQuery); } } } }