Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Need macro for XI 3.1 to retrieve info

$
0
0

Here's the Java code that I use for this - this I part of a class that contains information about reports.  The problem you're going to run into with this is that I have "helper" classes that I use for doing things like querying the InfoStore and converting dates (dates in BO are stored as UTC so you have to convert them to your local timezone to get the local time...)

 

private void loadLastRunInfo(Integer parentId, QueryHelper qh, Logger log){
    Date tmpDate = null;
    String tmpOwner = "";
    String qry = "Select top 10000 SI_ID, SI_UPDATE_TS, SI_OWNER from CI_INFOOBJECTS where SI_PARENTID = %d and SI_INSTANCE = 1 and SI_SCHEDULE_STATUS = 1 order by SI_UPDATE_TS desc";
    try {
        IInfoObjects iobjs = qh.executeRawQuery(String.format(qry, parentId));
        IInfoObject iobj = (IInfoObject) iobjs.get(1);
        tmpDate = iobj.getUpdateTimeStamp();
        tmpOwner = PropertyHelper.getStringProp(iobj.properties(), "SI_OWNER", log);
    } catch (SDKException e) {
        log.error(String.format("Unable to get last run date for %d-%s.  Err=%s", parentId, this.title, e.getDetailMessage()));
    }

    if (tmpDate != null){
        this.lastRun = DateHelper.getLocalDateFromUTC(tmpDate);
        this.lastRunOwner = tmpOwner;
    }
}

 

-Dell


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>