Beispiel #1
0
        public bool GenerateWorkflow(GenerateWorkflowRequest req, ref string err)
        {
            err = "";
            bool logErr = false;

            try
            {
                WorkflowEvent e = new WorkflowEvent(WorkflowCmd.GenerateWorkflow, req);
                m_ThreadContext.Post(new SendOrPostCallback(ProcessRequest), e);

                err = "Your request is being processed. It'll take a moment to finish.";
                return(true);
            }
            catch (Exception ex)
            {
                err = string.Format("GenerateWorkflow, FileId={0}, Workflow Templ Id={1}, Exception: {2}", req.FileId, req.WorkflowTemplId, ex.Message);
                int Event_id = 7063;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                return(false);
            }
            finally
            {
                if (logErr)
                {
                    int Event_id = 7064;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
            }
        }
Beispiel #2
0
        public bool CalculateDueDates(CalculateDueDatesRequest req, ref string err)
        {
            err = "";
            bool logErr = false;

            try
            {
                WorkflowEvent e = new WorkflowEvent(WorkflowCmd.CalculateDueDates, req);
                m_ThreadContext.Post(new SendOrPostCallback(ProcessRequest), e);
                err = "Your request is being processed. It'll take a moment to finish.";
                return(true);
            }
            catch (Exception ex)
            {
                err = "CalculateDueDates, Exception:" + ex.Message;
                int Event_id = 7065;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                return(false);
            }
            finally
            {
                if (logErr)
                {
                    int Event_id = 7066;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
            }
        }
Beispiel #3
0
        public void ProcessRequest(object o)
        {
            string err    = "";
            bool   logErr = false;
            bool   fatal  = false;

            try
            {
                if (o == null)
                {
                    err = "Process Request, Workflow Event is null.";
                    int Event_id = 7058;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
                WorkflowEvent e = o as WorkflowEvent;
                if (e == null)
                {
                    err = "Process Request, Workflow Event is null.";
                    int Event_id = 7059;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }
                if (e.RequestMsg == null)
                {
                    err = "Process Request, Workflow Request Message is null.";
                    int Event_id = 7060;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                    return;
                }
                switch (e.RequestType)
                {
                case WorkflowCmd.GenerateWorkflow:
                    GenerateWorkflowRequest req = e.RequestMsg as GenerateWorkflowRequest;
                    GenWorkflow_Internal(req);
                    break;

                case WorkflowCmd.MonitorLoans:
                    MonitorLoans();
                    break;

                case WorkflowCmd.CalculateDueDates:
                    CalculateDueDatesRequest req1 = e.RequestMsg as CalculateDueDatesRequest;
                    CalcuateDueDates_Internal(req1);
                    break;

                case WorkflowCmd.UpdateEstCloseDate:
                    UpdateEstCloseDateRequest req2 = e.RequestMsg as UpdateEstCloseDateRequest;
                    UpdateEstCloseDate(req2);
                    break;
                }
            }
            catch (Exception ex)
            {
                err = "ProcessRequest, Exception:" + ex.Message;
                int Event_id = 7061;
                EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
            }
            finally
            {
                if (logErr)
                {
                    int Event_id = 7062;
                    EventLog.WriteEntry(InfoHubEventLog.LogSource, err, EventLogEntryType.Warning, Event_id, Category);
                }
            }
            return;
        }