OnError Event Oracle BI Scheduler Script Object Methods and Events

Programming BI Scheduler VBScript and JScript Jobs 4-17 Schedules a new job with a Weekly trigger. Syntax: ScheduleJobWeekly name, description, scriptType, script, startDate, startTime, endTime, minutesInterval, weeksInterval, whichDays [, parameters, flags, maxRunTimeMS, maxConcurrentInstances, endDate] Argument: See Table 4–18 for ScheduleJobWeekly method arguments.

4.8.13 OnError Event

This topic is part of Section 4.8, Oracle BI Scheduler Script Object Methods and Events. Occurs when the script engine encounters a run-time error while executing the script. This is intended for cleanup purposes, but the creative use of trycatch blocks in JScript and appropriate Error Handling in VBScript are often superior alternatives to using this event. Usage: The script engine calls this procedure when it encounters a run-time error while executing the script. Define this procedure in your script to perform cleanup Table 4–18 ScheduleJobWeekly Method Arguments Argument Description name A string that specifies the name of the job. description A string that specifies the description of the job. scriptType A string that specifies the script type that is associated with the job either VBScript or JScript. script A string that specifies the script code or path if the nqJobScriptContainsPath flag is set that is associated with the job. startDate A date value that specifies the date that the job is activated. startTime A date value that specifies the time that the job is activated. endTime A date value that specifies the time that the job is deactivated. minutesInterval A long value that specifies the number of minutes between consecutive job executions. weeksInterval An integer value that specifies the number of weeks between job invocations. whichDays An integer value that specifies the days of the week on which the job runs. See Section 4.7.3, DayOfWeekEnum Constants for valid settings. parameters Optional A string array of parameter values that is passed to the script. The default is an empty array. flags Optional A long value that specifies the flags that are associated with the job. For valid settings, see Section 4.7.4, JobFlagsEnum Constants . The default is nqJobNoFlags. maxRunTimeMS Optional A long value that specifies the maximum time in milliseconds that a job runs before it is terminated. The default is 0 zero, which means the job can run indefinitely. maxConcurrentInstance s Optional A long value that specifies the maximum number of concurrent running instances of this job. The default is 0 zero, which means no limit. endDate Optional A date value that specifies the time that the job is deactivated. 4-18 Scheduling Jobs Guide for Oracle Business Intelligence Enterprise Edition activities before the script terminates, such as deleting temporary files and releasing resources. Syntax: OnError Example 4–2 Using VBScript: Public Sub OnError LogFile.WriteLine Encountered a runtime error in the script. LogFile.Close End Sub Example 4–3 Using JScript: function OnError { LogFile.WriteLineEncountered a runtime error in the script.; LogFile.Close;

4.9 Troubleshooting JScript and VBScript Job Failures