Oracle® Business Intelligence Scheduler Guide > Using Oracle BI Scheduler Job Scripts >

Script for iBot Chaining


This topic provides an example of setting up a script for Oracle BI Scheduler. The following script copies the results of an iBot to another directory. It copies the temporary file containing the results of the Conditional Request to the iBot log directory. The JobID, InstanceID, and UserID are used in the file name to guarantee that the result sets will not overwrite each other with each execution of the iBot, for each user, or for other iBots that share this script.

The example script uses the following setup:

  • The iBot log directory on Oracle BI Scheduler machine is $OracleBI\server\Log\iBots (where $OracleBI is the location in which the Oracle BI software is installed).
  • The iBot is run as Administrator
  • The Custom Script Properties are set according to the table in Configuring Custom Script Properties for Oracle BI Delivers
  • The job ID is 101 (assigned by Oracle BI Scheduler)
  • The instance ID is 1208 (assigned by Oracle BI Scheduler)

The output of this example, after the iBot is run, is a file on the Oracle BI Scheduler machine called D:\OracleBI\Log\iBots\101-1208-Administrator-iBotScript1.PDF. This file contains the results of the Conditional Request in PDF format.

For all scripts from chained iBots, the full path name to the temporary file is specified in Parameter(0).

/////////////////////////////////////////////////////////////
//
// createResultFile.js
//
// Copies the results in the temporary file to a new file name
//
// Parameter(0) = iBot Result File Path
// Parameter(1) = Last Part of Output File Name (no path)
//
/////////////////////////////////////////////////////////////

var FSO = new ActiveXObject("Scripting.FileSystemObject");

var fileName = GetConfigurationValue("Log Dir", "iBots") +
    "\\" + JobID + "-" + InstanceID + "-" + UserID + "-" +
    Parameter(1);

var fooFile = FSO.CopyFile(Parameter(0), fileName, true);

Oracle® Business Intelligence Scheduler Guide Copyright © 2007, Oracle. All rights reserved.