0

I have to extract the runtime and some other information from the following query with the BusinessObjects XI Java SDK.

SELECT SI_STARTTIME, SI_ENDTIME, SI_NAME, SI_SCHEDULE_STATUS, SI_DESCRIPTION, SI_SCHEDULEINFO.SI_SCHEDULE_INTERVAL_MONTHS, SI_SCHEDULEINFO.SI_SCHEDULE_INTERVAL_NDAYS, SI_SCHEDULEINFO.SI_SCHEDULE_INTERVAL_NTHDAY, SI_SCHEDULEINFO.SI_SCHEDULE_INTERVAL_MINUTES, SI_SCHEDULEINFO.SI_SCHEDULE_INTERVAL_HOURS, SI_SCHEDULEINFO.SI_SUBMITTER FROM CI_INFOOBJECTS WHERE SI_INSTANCE=1

I have some trouble to extract the runtime of a scheduled job. I tried to subtract the endtime from the starttime but the result was wrong. I expected 5 seconds and 13897452000 seconds given.

Have anyone an idea how I could get the runtime of a scheduled job?

Qwerky
  • 18,217
  • 6
  • 44
  • 80
Patrick Vogt
  • 898
  • 2
  • 14
  • 33

1 Answers1

2

Try using the ISchedulingInfo interface to retrieve the two dates. Load your IInfoObject (here named scheduledInstance) with the scheduling properties, then:

ISchedulingInfo schedInfo = scheduledInstance.getSchedulingInfo(); 
Date beginDate = schedInfo.getBeginDate(); 
Date endDate = schedInfo.getEndDate();
emilys
  • 189
  • 1
  • 13
  • Thank you for your proposal. How could I transform the difference of this dates into a mysql time object? – Patrick Vogt Dec 21 '12 at 17:50
  • 1
    I'm not sure what you mean by MySQL time object, but if what you are looking for is the difference between the start time and the end time, you can calculate that from the two java.util.Date objects. The getTime() method will give you each value in milliseconds; you can then convert the difference as you like. – emilys Dec 27 '12 at 08:55
  • schedInfo.getBeginDate() appears to be the next run date of scheduled objects, but only if si_nextruntime, si_scheduleinfo, and si_recurring are selected. Without those getBeginDate was giving me the same value from minutes or hours ago for all selected reports, even if they last ran much longer ago and getEndDate was always 10 years later. Not valid values to calculate runtime/duration. https://joeonbi.wordpress.com/2016/07/05/getbegindate-mystery-solved/ – jla May 10 '21 at 16:03