The RunJob Method |
The RunJob method of the BatchRunner component has the following parameters:
The job-name parameter is the only mandatory parameter. It has to be the first input parameter and does not need to be named. Input parameters 4 through 12 are optional pre-defined parameters, the same that can be specified for the ActionStartJob() method. They all start with a minus to indicate that they are USoft pre-defined. User-defined parameters are not allowed to start with a minus. Input parameters 13, 14, ... are user-defined parameters as specified in the input not provided. The order is which all optional parameters are specified is of no importance. They are passed to the component by name. When the select under the invoke retrieves multiple records, the job is called multiple times. The ReturnStatus parameter can be used to specify that an XML status message, in the form '<result>Error</result>', is to be returned in the event of an error. If you set this parameter, the statement 'invoke batchrunner.runjob ... ' will no longer fail in the event of an error. You can also build your own error handling mechanism, making use of the return status. If the ReturnStatus parameter is set to Yes:
If the ReturnStatus parameter is set to No (or not set at all):
Examples: An example of a simple call that runs the MyFirstJob job, is: INVOKE BatchRunner.RunJob WITH SELECT 'MyFirstJob' When calling the BatchRunner component, you can also use the function call syntax: SELECT BatchRunner.RunJob('MyJob', 'True' as "-quiet", contract_id as "contract_id") An example of a more complex call with many input parameters is: INVOKE BatchRunner.RunJob WITH SELECT 'MySecondJob', 'True' "-quiet", my_data_dir "-my import task:data_directory", '#' "-nvl", 23 "contract_id", 56 "department_id" FROM SystemSettings The output of the RunJob method is a string containing an XML document. The format is the same as the output of the XML.SqlExport method. The contents are all records from the output parameter set table. When the job has an output parameter set, then the output XML contains exactly one output record with one column (just like XML.SqlExport). If the job does not have an output parameter set, the output column is NULL. |