// TODO 9: log to build console "awaiting completion of job xyz"
return;
}
if (jn != null){
Jenkins jenkins = Jenkins.getInstance();
TopLevelItem it = jenkins.getItem(jn);
if (it == null){
LOG.info("unable to launch job "+jn+", it=null");
}else if (!(it instanceof Project)){
LOG.info("unable to launch job "+jn+", because it's not a Project, but just "+it.getClass());
}else{
// TODO 8: would like to have AbstractProject here, but it doesn't have BuildWrappers.
Project p = (Project)it;
DescribableList wrappers = p.getBuildWrappersList();
JenkowBuildWrapper wrapper = new JenkowBuildWrapper();
if (!wrappers.contains(wrapper.getDescriptor())) wrappers.add(wrapper);
p.scheduleBuild2(jenkins.getQuietPeriod(),new WorkflowCause("triggered by workflow"),ja);
return;
}
}
// TODO 9: need test for Jenkins task with empty / non-existing job name