public virtual ProcessDefinitionBuilder ExecutionListener(string eventName, IDelegateListener <IBaseDelegateExecution> executionListener)
 {
     if (transition == null)
     {
         ScopeStack.Peek().AddExecutionListener(eventName, executionListener);
     }
     else
     {
         transition.AddExecutionListener(executionListener);
     }
     return(this);
 }
示例#2
0
        protected internal virtual void InitExecutionListeners(IHistoryEventProducer historyEventProducer,
                                                               IHistoryLevel historyLevel)
        {
            ProcessInstanceStartListener = new ProcessInstanceStartListener(historyEventProducer, historyLevel);
            ProcessInstanceEndListener   = new ProcessInstanceEndListener(historyEventProducer, historyLevel);

            ActivityInstanceStartListener = new ActivityInstanceStartListener(historyEventProducer, historyLevel);
            ActivityInstanceEndListener   = new ActivityInstanceEndListener(historyEventProducer, historyLevel);

            UserTaskAssignmentHandler = new ActivityInstanceUpdateListener(historyEventProducer, historyLevel);
            UserTaskIdHandler         = UserTaskAssignmentHandler;
        }
 public virtual ProcessDefinitionBuilder ExecutionListener(IDelegateListener <IBaseDelegateExecution> executionListener)
 {
     if (transition != null)
     {
         transition.AddExecutionListener(executionListener);
     }
     else
     {
         throw new PvmException("not in a transition scope");
     }
     return(this);
 }
示例#4
0
        protected internal virtual void AddListenerToMap(IDictionary <string, IList <IDelegateListener <IBaseDelegateExecution> > > listenerMap, string eventName,
                                                         IDelegateListener <IBaseDelegateExecution> listener, int index)
        {
            IList <IDelegateListener <IBaseDelegateExecution> > listeners;

            listenerMap.TryGetValue(eventName, out listeners);
            if (listeners == null)
            {
                listeners = new List <IDelegateListener <IBaseDelegateExecution> >();
                listenerMap[eventName] = listeners;
            }
            if (index < 0)
            {
                listeners.Add(listener);
            }
            else
            {
                listeners.Insert(index, listener);
            }
        }
示例#5
0
 public virtual void AddExecutionListener(string eventName, IDelegateListener <IBaseDelegateExecution> executionListener, int index)
 {
     AddListener(eventName, executionListener, index);
 }
示例#6
0
 public virtual void AddListener(string eventName, IDelegateListener <IBaseDelegateExecution> listener, int index)
 {
     AddListenerToMap(listeners, eventName, listener, index);
 }
示例#7
0
 public virtual void AddBuiltInListener(string eventName, IDelegateListener <IBaseDelegateExecution> listener)
 {
     AddBuiltInListener(eventName, listener, -1);
 }
示例#8
0
 public virtual void AddExecutionListener(IDelegateListener <IBaseDelegateExecution> executionListener)
 {
     AddListener(ExecutionListenerFields.EventNameTake, executionListener);
 }
示例#9
0
 public void InvokeListener(IDelegateListener <IBaseDelegateExecution> listener)
 {
     listener.Notify(this);
 }
 public ExecutionListenerInvocation(IDelegateListener <IBaseDelegateExecution> executionListenerInstance, IDelegateExecution execution)
     : base(execution, null)
 {
     this.ExecutionListenerInstance = executionListenerInstance;
     this.Execution = execution;
 }