private void NotifyChannels(TrackingWorkflowEvent evt, WorkflowExecutor.WorkflowExecutionEventArgs e, WorkflowExecutor exec)
        {
            DateTime utcNow = DateTime.UtcNow;
            int nextEventOrderId = this._broker.GetNextEventOrderId();
            foreach (TrackingChannelWrapper wrapper in this._channels)
            {
                WorkflowExecutor.WorkflowExecutionTerminatingEventArgs args2;
                WorkflowTrackingRecord record;
                EventArgs eventArgs = null;
                switch (evt)
                {
                    case TrackingWorkflowEvent.Exception:
                    {
                        WorkflowExecutor.WorkflowExecutionExceptionEventArgs args3 = (WorkflowExecutor.WorkflowExecutionExceptionEventArgs) e;
                        eventArgs = new TrackingWorkflowExceptionEventArgs(args3.Exception, args3.CurrentPath, args3.OriginalPath, args3.ContextGuid, args3.ParentContextGuid);
                        goto Label_00BC;
                    }
                    case TrackingWorkflowEvent.Terminated:
                        args2 = (WorkflowExecutor.WorkflowExecutionTerminatingEventArgs) e;
                        if (args2.Exception == null)
                        {
                            break;
                        }
                        eventArgs = new TrackingWorkflowTerminatedEventArgs(args2.Exception);
                        goto Label_00BC;

                    case TrackingWorkflowEvent.Suspended:
                        eventArgs = new TrackingWorkflowSuspendedEventArgs(((WorkflowExecutor.WorkflowExecutionSuspendingEventArgs) e).Error);
                        goto Label_00BC;

                    default:
                        goto Label_00BC;
                }
                eventArgs = new TrackingWorkflowTerminatedEventArgs(args2.Error);
            Label_00BC:
                record = new WorkflowTrackingRecord(evt, utcNow, nextEventOrderId, eventArgs);
                if (wrapper.GetTrackingProfile(exec).TryTrackInstanceEvent(evt, record))
                {
                    wrapper.TrackingChannel.Send(record);
                }
            }
        }
예제 #2
0
 static void WriteSuspendedEventArgs(string eventDescription, TrackingWorkflowSuspendedEventArgs suspendedEventArgs, DateTime eventDataTime)
 {
     Console.WriteLine("\nSuspended Event Arguments Read From Tracking Database:\n");
     Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
     Console.WriteLine("EventDescription: " + eventDescription);
     Console.WriteLine("SuspendedEventArgs Info: " + suspendedEventArgs.Error);
 }