Skip to content

Commit

Permalink
Merge pull request sakaiproject#2042 from ern/SAK-30525
Browse files Browse the repository at this point in the history
SAK-30525 Job was not set on the trigger
  • Loading branch information
ern committed Mar 29, 2016
2 parents 6acd87f + 0a49ae3 commit 5c0fb91
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -788,30 +788,28 @@ public String processCreateTrigger()
LOG.error("Scheduler is down!");
return "error";
}
try
{
JobDetail
jd = selectedJobDetailWrapper.getJobDetail();

Trigger trigger = TriggerBuilder.newTrigger()
.withIdentity(jd.getKey().getName(), Scheduler.DEFAULT_GROUP)
.withSchedule(CronScheduleBuilder.cronSchedule(triggerExpression))
.build();

try {
JobDetail jobDetail = selectedJobDetailWrapper.getJobDetail();

Trigger trigger = TriggerBuilder.newTrigger()
.withIdentity(triggerName, Scheduler.DEFAULT_GROUP)
.withSchedule(CronScheduleBuilder.cronSchedule(triggerExpression))
.forJob(jobDetail.getKey())
.build();

TriggerWrapper tempTriggerWrapper = new TriggerWrapperImpl();
tempTriggerWrapper.setTrigger(trigger);

JobBeanWrapper
job = getSchedulerManager().getJobBeanWrapper(selectedJobDetailWrapper.getJobType());

if (job != null)
JobBeanWrapper jobWrapper = getSchedulerManager().getJobBeanWrapper(selectedJobDetailWrapper.getJobType());

if (jobWrapper != null)
{
if (ConfigurableJobBeanWrapper.class.isAssignableFrom(job.getClass()))
if (ConfigurableJobBeanWrapper.class.isAssignableFrom(jobWrapper.getClass()))
{
final ConfigurableJobBeanWrapper
configurableJob = (ConfigurableJobBeanWrapper)job;
configurableJob = (ConfigurableJobBeanWrapper)jobWrapper;

setJobDetail (jd);
setJobDetail (jobDetail);
setConfigurableJobBeanWrapper (configurableJob);
setTriggerWrapper (tempTriggerWrapper);

Expand Down

0 comments on commit 5c0fb91

Please sign in to comment.