I am using 2012 R2 Pack with latest QFE installed.
Trying to create a 'child job' to do some "cleanup" after the main job is complete. But the child job does not get created (no error/exception either). What could i be missing. Here is the code:
int intSessionId;
using (DurableSession session = DurableSession.CreateSession(info))
{
intSessionId = session.Id;
using (BrokerClient<IComputeWorker> client = new BrokerClient<IComputeWorker>(session))
{
..
..
}
}
//main job succesfully submitted.
//Now,create a child job
IScheduler scheduler2 = new Scheduler();
scheduler2.Connect(ConfigurationManager.AppSettings["HPCHeadNode"]);
ISchedulerJob childjob = scheduler2.CreateJob();
childjob.Name = "Cleanup for Job Id:" + intSessionID.ToString();
childjob.SetJobTemplate("MyJobTemplate");
childjob.Project = "Project Name" + ProjectID.ToString();
IIntCollection parentjobcollection = scheduler2.CreateIntCollection();
parentjobcollection.Add(intSessionID);
childjob.ParentJobIds = parentjobcollection;
ISchedulerTask task = childjob.CreateTask();
task.CommandLine = @"\\uncpath\HPCJobCleanup.exe " + intSessionID.ToString();
childjob.AddTask(task);
scheduler2.SubmitJob(childjob, Environment.UserDomainName + @"\" + Environment.UserName,strPassword);