Пример #1
0
        static void Main(string[] args)
        {
            const String               all       = "*";
            AutoResetEvent             syncEvent = new AutoResetEvent(false);
            ConsoleTrackingParticipant customTrackingParticipant = new ConsoleTrackingParticipant()
            {
                // Create a tracking profile to subscribe for tracking records
                // In this sample the profile subscribes for CustomTrackingRecords,
                // workflow instance records and activity state records
                TrackingProfile = new TrackingProfile()
                {
                    Name    = "CustomTrackingProfile",
                    Queries =
                    {
                        new CustomTrackingQuery()
                        {
                            Name         = all,
                            ActivityName = all
                        },
                        new WorkflowInstanceQuery()
                        {
                            // Limit workflow instance tracking records for started and completed workflow states
                            States ={ WorkflowInstanceStates.Started,              WorkflowInstanceStates.Completed },
                        },
                        new ActivityStateQuery()
                        {
                            // Subscribe for track records from all activities for all states
                            ActivityName = all,
                            States       = { all },

                            // Extract workflow variables and arguments as a part of the activity tracking record
                            // VariableName = "*" allows for extraction of all variables in the scope
                            // of the activity
                            Variables =
                            {
                                { all }
                            }
                        }
                    }
                }
            };


            WorkflowInvoker invoker = new WorkflowInvoker(BuildSampleWorkflow());

            invoker.Extensions.Add(customTrackingParticipant);

            invoker.Invoke();
        }
Пример #2
0
        static void Main(string[] args)
        {
            const String all = "*";
            AutoResetEvent syncEvent = new AutoResetEvent(false);
            ConsoleTrackingParticipant customTrackingParticipant = new ConsoleTrackingParticipant()
            {
                // Create a tracking profile to subscribe for tracking records
                // In this sample the profile subscribes for CustomTrackingRecords,
                // workflow instance records and activity state records
                TrackingProfile = new TrackingProfile()
                {
                    Name = "CustomTrackingProfile",
                    Queries =
                    {
                        new CustomTrackingQuery()
                        {
                         Name = all,
                         ActivityName = all
                        },
                        new WorkflowInstanceQuery()
                        {
                            // Limit workflow instance tracking records for started and completed workflow states
                            States = { WorkflowInstanceStates.Started, WorkflowInstanceStates.Completed },
                        },
                        new ActivityStateQuery()
                        {
                            // Subscribe for track records from all activities for all states
                            ActivityName = all,
                            States = { all },

                            // Extract workflow variables and arguments as a part of the activity tracking record
                            // VariableName = "*" allows for extraction of all variables in the scope
                            // of the activity
                            Variables =
                            {
                                { all }
                            }
                        }
                    }
                }
            };

            WorkflowInvoker invoker = new WorkflowInvoker(BuildSampleWorkflow());
            invoker.Extensions.Add(customTrackingParticipant);

            invoker.Invoke();
        }