on 01-11-2012 3:40 PM
Dear Experts
I'm trying to schedule the job, but while schuduling the job its saying "taskId 'b7611dee12bc714b421b77212cc16329' has only execution times in the past and thus it can not be scheduled.
I don't understand whats wrong here.
below is code used for scheduling task.
String date1 = wdContext.currentScheduleJobElement().getScheduleDate().toString();
String[] DateSelection = date1.split("-");
String month = DateSelection[0];
int month1 = Integer.parseInt(month.trim());
String day = DateSelection[1];
int day1 = Integer.parseInt(day.trim());
String year = DateSelection[2];
int year1 = Integer.parseInt(year.trim());
String time2[] = wdContext.currentScheduleJobElement().getScheduleTime().toString().split(":");
String hours = time2[0];
int hours1 = Integer.parseInt(hours.trim());
String mints = time2[1];
int mints1 = Integer.parseInt(mints.trim());
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.set(Calendar.YEAR, year1);
calendar.set(Calendar.MONTH,month1-1);
calendar.set(Calendar.DAY_OF_MONTH, day1);
calendar.set(Calendar.HOUR_OF_DAY, hours1);
calendar.set(Calendar.MINUTE, mints1+2);
java.util.Date date = calendar.getTime();
wdComponentAPI.getMessageManager().reportSuccess("Your Task is Scheduled On Date : "+ date);
SchedulerTime time = new SchedulerTime(date, calendar.getTimeZone());
//Create RecurringEntry and pass to it SchedulerTime instance
RecurringEntry re = new RecurringEntry(time);
// set job parameter
UUID uuid = UUID.randomUUID();
randomUUIDString = uuid.toString().replaceAll("-", "1");
randomUUIDString = randomUUIDString.substring(0, 32);
JobParameterDefinition user = syncdef.getParameter("JobID");
JobParameter userparameter = new JobParameter(user,randomUUIDString);
//SchedulerTaskID.newID(),syncdef.getJobDefinitionId()
SchedulerTask task = new SchedulerTask(SchedulerTaskID.parseID(randomUUIDString),syncdef.getJobDefinitionId(), new JobParameter[]
,new RecurringEntry[] , new CronEntry[] {},userparameter"","Job is Scheduled by User:"_userId" :"userparameter);
syncscheduler.schedule(task);
Any Help will greatly appricated.
Thanks
AB
post full stacktrace here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.