public override void OnUpdateFormula(Net.Vpc.Upa.Callbacks.UpdateFormulaEvent @event) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     Net.Vpc.Upa.Impl.Context.DefaultEntityTriggerContext context = new Net.Vpc.Upa.Impl.Context.DefaultEntityTriggerContext(@event.GetEntity(), @event.GetTrigger(), @event.GetContext());
     foreach (object aK in ResolveIdList(@event, @event.GetFilterExpression()))
     {
         keyInterceptor.AfterUpdateFormulas(context, aK, @event.GetUpdates());
     }
 }
 public override object Invoke(params object [] arguments)
 {
     Net.Vpc.Upa.Callbacks.UpdateFormulaEvent ev = (Net.Vpc.Upa.Callbacks.UpdateFormulaEvent)arguments[0];
     foreach (object id in ResolveIdList(ev, ev.GetFilterExpression()))
     {
         Net.Vpc.Upa.Callbacks.UpdateFormulaObjectEvent oe = new Net.Vpc.Upa.Callbacks.UpdateFormulaObjectEvent(id, ev.GetUpdates(), ev.GetFilterExpression(), ev.GetContext(), GetPhase());
         InvokeSingle(oe);
     }
     return(null);
 }
Beispiel #3
0
 public override void OnPreUpdateFormula(Net.Vpc.Upa.Callbacks.UpdateFormulaEvent @event) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     Net.Vpc.Upa.Persistence.EntityExecutionContext executionContext = @event.GetContext();
     Net.Vpc.Upa.Relationship r = relation;
     System.Collections.Generic.IList <Net.Vpc.Upa.Field> fs = r.GetSourceRole().GetFields();
     Net.Vpc.Upa.Expressions.Expression cond = new Net.Vpc.Upa.Expressions.Equals(new Net.Vpc.Upa.Expressions.Var(fs[0].GetName()), Net.Vpc.Upa.Expressions.Literal.NULL);
     if (@event.GetFilterExpression() != null)
     {
         cond = new Net.Vpc.Upa.Expressions.And(cond, @event.GetFilterExpression());
     }
     System.Collections.Generic.IList <object> keys = relation.GetSourceRole().GetEntity().CreateQueryBuilder().ByExpression(cond).GetIdList <K>();
     foreach (object key in keys)
     {
         support.ValidatePathField(key, executionContext);
         support.ValidateChildren(key, executionContext);
     }
 }
Beispiel #4
0
 public virtual void FireBeforeFormulasUpdate(Net.Vpc.Upa.Record updates, Net.Vpc.Upa.Expressions.Expression condition, Net.Vpc.Upa.Persistence.EntityExecutionContext context) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     //        Object methodExecId = Math.random();
     //        Log.method_enter(methodExecId, getName(), updates, condition);
     //        entity.preUpdateTable(updates, condition, context);
     Net.Vpc.Upa.Callbacks.UpdateFormulaEvent @event = null;
     if (entity.GetPersistenceUnit().IsTriggersEnabled())
     {
         foreach (Net.Vpc.Upa.Callbacks.Trigger et in entity.GetSoftTriggers())
         {
             Net.Vpc.Upa.Impl.DefaultTrigger t = (Net.Vpc.Upa.Impl.DefaultTrigger)et;
             //                Log.log(EditorConstants.Logs.TRIGGER, "<START " + getName() + ".fireBeforeUpdate> " + t.toString());
             try {
                 Net.Vpc.Upa.Callbacks.EntityListener li = t.GetListener();
                 if (@event == null)
                 {
                     @event = new Net.Vpc.Upa.Callbacks.UpdateFormulaEvent(updates, condition, context, Net.Vpc.Upa.EventPhase.BEFORE);
                 }
                 li.OnPreUpdateFormula(@event);
             } catch (Net.Vpc.Upa.Exceptions.UPAException ex) {
                 log.TraceEvent(System.Diagnostics.TraceEventType.Error, 100, Net.Vpc.Upa.Impl.FwkConvertUtils.LogMessageExceptionFormatter("problem when executing trigger " + t.GetName() + ".onPreUpdateFormula(" + t.GetEntity().GetName() + "," + condition + ")", ex));
                 //                    Log.bug("19987", "problem when executing trigger " + t.getName() + ".beforeUpdate(" + getName() + "," + condition + ")");
                 //                    Log.bug(e);
                 throw ex;
             }
         }
     }
     //                Log.log(EditorConstants.Logs.TRIGGER, "<END   " + getName() + ".fireBeforeUpdate> " + t.toString());
     if (@event == null)
     {
         @event = new Net.Vpc.Upa.Callbacks.UpdateFormulaEvent(updates, condition, context, Net.Vpc.Upa.EventPhase.BEFORE);
     }
     foreach (Net.Vpc.Upa.Callback invoker in persistenceUnitListenerManager.GetPreCallbacks(Net.Vpc.Upa.CallbackType.ON_UPDATE_FORMULAS, Net.Vpc.Upa.ObjectType.ENTITY, @event.GetEntity().GetName(), Net.Vpc.Upa.Impl.Event.PersistenceUnitListenerManager.DEFAULT_SYSTEM))
     {
         invoker.Invoke(@event);
     }
     foreach (Net.Vpc.Upa.PreparedCallback invoker in persistenceUnitListenerManager.GetPostPreparedCallbacks(Net.Vpc.Upa.CallbackType.ON_UPDATE_FORMULAS, Net.Vpc.Upa.ObjectType.ENTITY, @event.GetEntity().GetName(), Net.Vpc.Upa.Impl.Event.PersistenceUnitListenerManager.DEFAULT_SYSTEM))
     {
         invoker.Prepare(@event);
     }
 }
 public virtual void OnUpdateFormula(Net.Vpc.Upa.Callbacks.UpdateFormulaEvent @event)
 {
 }