Hi Team,
I'm writing a program to run a job with the SDK, check the status and retry if there's an error.
//LAUNCH JOB
SearchPathSingleObject searchPathSingle = new SearchPathSingleObject("/content/folder[@name='XXX']/folder[@name='XXX']/jobDefinition[@name='JOB_XX']");
Option[] runOptions = new Option[0];
ParameterValue[] parameterValues = new ParameterValue[0];
AsynchReply asynchReplyRes = test.connectionSrc.getJobService().run(searchPathSingle, parameterValues, runOptions);
//GET EVENT ID
AsynchDetailEventID eventID = (AsynchDetailEventID) asynchReplyRes.getDetails()[0];
//Relaunch on Error
SearchPathSingleObject relaunchPath= new SearchPathSingleObject("/content/folder[@name='XXX']/folder[@name='XXX']/jobDefinition[@name='JOB_XX']/history[@eventID='"+eventID+"']");
AsynchOptionSearchPathSingleObject relaunchOption = new AsynchOptionSearchPathSingleObject(AsynchOptionEnum.restartHistoryLocation,relaunchPath);
// add restartHistoryLocation to Option
Option[] runOptionsRelaunch = new AsynchOption[]{relaunchOption };
AsynchReply asynchReplyResRelaunch = test.connectionSrc.getMonitorService().run(searchPathSingle,parameterValues,runOptionsRelaunch);
But I get the following error on retry
com.cognos.monitor.tse.TSEException: java.lang.NullPointerException
Can you help me with the restart?
Thanks
Valentin