If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Rerun Failed Task

Started by valentin, 03 Oct 2024 10:48:36 AM

Previous topic - Next topic

valentin

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