Inheritance: Deveel.Data.Diagnostics.Event
Exemple #1
0
        protected override void FireTrigger(TableEvent tableEvent, IBlock context)
        {
            var e = new TriggerEvent(TriggerType.Callback, TriggerInfo.TriggerName, tableEvent.Table.TableInfo.TableName, tableEvent.EventTime, tableEvent.EventType,
                tableEvent.OldRowId, tableEvent.NewRow);

            context.Context.RegisterEvent(e);
        }
 public void OnTriggerEvent(TriggerEvent trigger)
 {
     try {
         if (listener != null)
             listener(trigger);
     } catch (Exception ex) {
         // TODO: form a source...
         systemContext.EventRegistry.Error(null, ex);
     }
 }
 protected override ISystemContext CreateSystemContext()
 {
     var context = base.CreateSystemContext();
     context.ListenTriggers(trigger => {
         if ((trigger.TriggerEventType & TriggerEventType.After) != 0) {
             afterEvent = trigger;
         } else if ((trigger.TriggerEventType & TriggerEventType.Before) != 0) {
             beforeEvent = trigger;
         }
     });
     return context;
 }
        public static void FireTrigger(this IQueryContext context, TableEventContext tableEvent)
        {
            var eventSource = tableEvent.Table.FullName;
            var eventType = tableEvent.EventType;

            var triggers = context.Session.FindTriggers(eventSource, eventType);

            foreach (var trigger in triggers) {
                try {
                    trigger.Fire(tableEvent);

                    var oldRowId = tableEvent.OldRowId;
                    var newRow = tableEvent.NewRow;

                    var triggerEvent = new TriggerEvent(trigger.TriggerName, eventSource, eventType, oldRowId, newRow);

                    context.RegisterEvent(triggerEvent);
                } catch (Exception) {
                    // TODO: throw a specialized exception
                    throw;
                }
            }
        }
Exemple #5
0
        private void NotifyTriggerEvent(IQueryContext context, TableEventContext tableEvent)
        {
            var tableName = tableEvent.Table.FullName;
            var eventType = tableEvent.EventType;

            var triggerEvent = new TriggerEvent(context.Session, TriggerName, tableName, eventType, tableEvent.OldRowId,
                tableEvent.NewRow);
            context.RegisterEvent(triggerEvent);
        }