Hello,
I want to kick off a PostAlert action that will submit another job. The code I have works in the shell when I test but I am unable to compile it when I use it as a PostAlert.
{
// code to submit a job running MyJob
// get the job definition
JobDefinition aJobDef = jcsSession.getJobDefinitionByName("MyJob");
// create the job from the job definition
Job aJob = aJobDef.prepare();
// assign queue
Queue aQ = jcsSession.getQueueByName("System");
aJob.setQueue(aQ);
// submit the job definition and write unsaved data to the database
jcsSession.persist();
}
Any suggestions on what I could be missing?
Thx,
Brian