}
}
}
public static OperResult addCronTrigger(String name,String group,String description,String cronExp,TaskInfo taskinfo,Map properties){
OperResult result = new OperResult();
if(taskinfo==null){
result.setFailed(TASK_INFO_NOTEXIST);
}else{
if(SchedulerProvider.scheduler==null){
result.setFailed(SCHEDULER_IS_NULL);
}else{
// Trigger trigger;
try {
JobDataMap jobDataMap = new JobDataMap();
CronTriggerImpl t = new CronTriggerImpl();
t.setKey(TriggerKey.triggerKey(name, group));
t.setDescription(description);
t.setCronExpression(cronExp);
t.setJobKey(GetObjectString.string2JobKey(taskinfo.getId()));
t.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
putMapData2JobDataMap(properties,jobDataMap);
t.setJobDataMap(jobDataMap);
// trigger = newTrigger()
// .withIdentity(name, group)
// .withDescription(description)
// .withSchedule(cronSchedule(cronExp))
// .forJob(GetObjectString.string2JobKey(taskinfo.getId()))
// .build();
SchedulerProvider.scheduler.scheduleJob(t);
result.setData(t.getKey().toString());
result.setSucceed();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
result.setFailed(e.getMessage());
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
result.setFailed(e.getMessage());
}
}
}
return result;
}