return;
}
// ensure all jobs are in a ready to run state
for (int jobN = 0; jobN < document.getJobDescriptionCount (); ++jobN) {
MonitorJobDescription jobDescription = document.getNthJobDescription (jobN);
if (!readyToRun (jobDescription)) {
JOptionPane.showMessageDialog (mainFrame, "The message source <"
+ jobDescription.getMessageSourceDescription ().getName ()
+ "> must have triggers and actions set.", "BAM Sample",
JOptionPane.WARNING_MESSAGE);
return;
}
}
// compile and start each job
try {
BasicCALServices calServices = getCalServices();
for (int jobN = 0; jobN < document.getJobDescriptionCount (); ++jobN) {
MonitorJobDescription jobDescription = document.getNthJobDescription (jobN);
GemGraphGenerator generator = new GemGraphGenerator (calServices, jobDescription);
//create each new job in separate modules.
ModuleName jobModuleName = ModuleName.make(jobDescription.getJobId().toUpperCase());
EntryPointSpec entry = calServices.addNewModuleWithFunction(jobModuleName, generator.getCalSource());
MessageSource messageSource = MessageSourceFactory.createMessageSource (jobDescription);
MonitorJob job = new MonitorJob (jobDescription, messageSource, entry);