Example #1
0
        /// <summary>
        /// 处理指定活动点
        /// </summary>
        /// <param name="approval"></param>
        /// <param name="processor"></param>
        /// <param name="auth"></param>
        /// <returns></returns>
        public bool Process(Approval approval, string processor, IWorkflowAuthority auth)
        {
            IProcessAction actionprocess = ApprovalProcessFacotry.Create((ApprovalStatus)approval.Status.Value);

            actionprocess.Process(this, approval, processor, auth);
            return(true);
        }
 public ComplexEventAction(string key, int processId, IList <IProcessExpectedEvent> events, Type expectedMessageType, IProcessAction action, IProcessStateInfo processInfo, ActionTrigger actionTrigger = ActionTrigger.All)//Todo:get rid of optional parameters
 {
     ProcessId           = processId;
     Events              = events;
     ExpectedMessageType = expectedMessageType;
     ProcessInfo         = processInfo;
     ActionTrigger       = actionTrigger;
     Key    = key;
     Action = action;
 }
Example #3
0
        public static IProcessAction Create(ApprovalStatus status)
        {
            IProcessAction action = null;

            switch (status)
            {
            case ApprovalStatus.Agree:
                action = new AgreeProcessAction();
                break;

            case ApprovalStatus.Disagree:
                action = new DisagreeProcessAction();
                break;

            case ApprovalStatus.None:
                action = new NextProcessAction();
                break;
            }
            return(action);
        }
Example #4
0
 public void Add(IPID processID, IProcessAction action)
 {
     if (processID.PID <= 0)
     {
         return;
     }
     IProcessHistory processHistory;
     if (!m_History.ContainsKey(processID))
     {
         string name;
         if (String.IsNullOrEmpty(processID.Name))
         {
             try
             {
                 name = Process.GetProcessById(processID.PID).ProcessName;
             }
             catch (Exception ex)
             {
                 name = "UNKNOWN";
             }
         }
         else
         {
             name = processID.Name;
         }
         IPID pid = new WinPID(processID.PID, name);
         processHistory = m_ProcessHistoryFactory.CreateProcessHistory(pid);
         processHistory.SnapshotReady += new EventHandler<SnapshotReadyEventArgs>(ProcessHistory_SnapshotReady);
         m_History.Add(pid, processHistory);
     }
     else
     {
         processHistory = m_History[processID];
     }
     processHistory.Add(action);
 }
Example #5
0
 public ExecuteComplexEventAction(IProcessAction action, IComplexEventParameters complexEventParameters, IStateCommandInfo processInfo, ISystemProcess process, ISystemSource source) : base(processInfo, process, source)
 {
     Action = action;
     ComplexEventParameters = complexEventParameters;
 }
 public void NewAction(IPID processID, IProcessAction action)
 {
     if (m_Filter.Count == 0 || m_Filter.Contains(processID))
     {
         m_GlobalHistory.Add(processID, action);
     }
 }
Example #7
0
 public ProcessSvc()
 {
     this.procDao      = new ProcessDao();
     this.procInstance = null;
 }
Example #8
0
 public void UpdateStats(IProcessAction action)
 {
     if (action.EventName.StartsWith("DiskIo") || action.EventName.StartsWith("FileIo"))
     {
         DiskFileActivity++;
     }
     else if (action.EventName.StartsWith("TcpIp") || action.EventName.StartsWith("UdpIp"))
     {
         NetActivity++;
     }
     else if (action.EventName.StartsWith("Registry"))
     {
         RegistryActivity++;
     }
     AffectedKeys.UnionWith(action.AffectedKeys);
 }
Example #9
0
 public void Add(IProcessAction action)
 {
     UpdateStats(action);
     m_List[m_Current] = action;
     m_Current = (m_Current + 1) % m_Limit;
     m_TotalAdded++;
     if (m_TotalAdded % m_Limit == 0)
     {
         if (SnapshotReady != null)
             SnapshotReady(this, new SnapshotReadyEventArgs(m_List, m_ProcessID));
     }
 }