executeBatch

The executeBatch method enables you to execute several methods with a single request to the runtime server.

function callExecuteBatch(commandsToExecute, callback) {

        if (!commandsToExecute)
            return ;

        InteractAPI.executeBatch(commandsToExecute.ssid, 
        commandsToExecute.commands, callback); 
}
  • session ID-A string identifying the session ID. This session ID is used for all commands run by this method call.
  • commands-An array of command objects, one for each command you want to perform.
  • callback - If the method was successful, the callback function calls onSuccess. If the method failed, the callback function calls onError.

The result of calling this method is equivalent to explicitly calling each method in the Command array. This method minimizes the number of actual requests to the runtime server. The runtime server runs each method serially; for each call, any error or warnings are captured in the Response object that corresponds to that method call. If an error is encountered, the executeBatch continues with the rest of the calls in the batch. If the running of any method results in an error, the top level status for the BatchResponse object reflects that error. If no error occurred, the top level status reflects any warnings that may have occurred. If no warning occurred, then the top level status reflects a successful run of the batch.

Return value

The runtime server responds to the executeBatch with a BatchResponse object.