Siebel Analytics Scheduler Guide > Configuring Siebel Analytics Scheduler Job Scripts > Analytics Scheduler Script Object Methods and Events >

RegisterCancelCommand Method

Registers a method to be called when the script is canceled.


RegisterCancelCommand source, methodName [, arguments]...


Arguments for RegisterCancelCommand method are shown in Table 30.

Table 30. RegisterCancelCommand Method Arguments


An object whose method is being registered.


A string that specifies the method name.


Optional arguments to be passed into the method.


Occasionally, an object's method takes a long time to complete. If the job is canceled before the call returns, the script engine still must wait until the call returns. This could potentially take hours and limit resources. This method solves the problem by registering a method that is asynchronously called by the script engine if the script gets canceled.

Cancel methods should be registered before calling the method that executes a long operation. When the method returns, the cancel method should be deregistered by calling DeregisterCancelCommand().

A good practice is to hide implementation details of a COM object from the caller, having the COM object itself handle all registration and deregistration of cancel commands. Pass an instance of the Script object to the COM object, then call the RegisterCancelCommand() and DeregisterCancelCommand() methods because the Script object implements the IDispatch interface.

Siebel Analytics Scheduler Guide