예제 #1
0
        public void AddJobs()
        {
            Log("AddJobs");
            //Cron Expression (* * * * * * *)
            //1st * denotes Seconds
            //2nd * denotes Minutes
            //3rd * denotes Hours
            //4th * denotes Day-of-Month
            //5th * denotes Month
            //6th * denotes Day-of-Week
            //7th * denotes Year (optional field)
            // "/" denotes increments.For example, "0/15" in the seconds field means "the seconds 0, 15, 30, and 45".
            //?  denotes no specific value

            //plan notifcation
            const string cronExpPlan               = " 0 0 0 1/1 * ? *"; // need to replace for every day 12 am :0 0 0 1/1 * ? *
            var          PlanNotificationJob       = new PlanNotificationJob();
            var          PlanNotificationJobDetail = new JobDetailImpl("kessakuPlanNotificationJob", "kessakuPlanNotificationGroup", PlanNotificationJob.GetType());
            var          PlanNotificationtrigger   = new CronTriggerImpl("kessakuPlanNotificationTrigger", "kessakuPlanNotificationGroup", cronExpPlan);

            _scheduler.ScheduleJob(PlanNotificationJobDetail, PlanNotificationtrigger);

            //yammer
            const string cronExpyammer               = " 0 0/1 * 1/1 * ? *  "; // need to replace for every 1 minute :0 0 0 1/1 * ? *
            var          YammerNotificationJob       = new YammerNotificationJob();
            var          YammerNotificationJobDetail = new JobDetailImpl("kessakuYammerNotificationJob", "kessakuYammerNotificationGroup", YammerNotificationJob.GetType());
            var          YammerNotificationtrigger   = new CronTriggerImpl("kessakuYammerNotificationTrigger", "kessakuYammerNotificationGroup", cronExpyammer);

            _scheduler.ScheduleJob(YammerNotificationJobDetail, YammerNotificationtrigger);
        }
예제 #2
0
        private static void AddJobs()
        {
            TraceService("start service");
            const string cronExpPlan               = "0 0/3 * 1/1 * ? *"; // need to replace for every day 12 am :0 0 0 1/1 * ? *
            var          planNotificationJob       = new PlanNotificationJob();
            var          planNotificationJobDetail = new JobDetailImpl("DashBoardPlanNotificationJob", "DashBoardPlanNotificationGroup", planNotificationJob.GetType());
            var          planNotificationtrigger   = new CronTriggerImpl("DashBoardPlanNotificationTrigger", "DashBoardPlanNotificationGroup", cronExpPlan);

            _scheduler.ScheduleJob(planNotificationJobDetail, planNotificationtrigger);
        }