Job Methods |
For each job, the internal BatchRunner component automatically contains a job method with the name of the job. This is the only method that can be used to call batch jobs from a constraint. The input parameters are the same as for the RunJob method, but the output parameters are different. Instead of having one XML output parameter, the output parameters match the elements in the output parameter set. Furthermore, the number of records returned by the method equals the number of records in the output parameter set. Example: For example, suppose a 'MyJob' job has an output parameter set with three elements. The BatchRunner component now contains a 'MyJob' method with the following parameters:
This INVOKE statement inserts zero, one, or more records in table T1: INSERT INTO T1 ( pk, col1, col2 ) INVOKE BatchRunner.MyJob WITH SELECT 23 "contract_id" When you create a CON flat file, the job methods are written to this flat file. After changing the output parameter set of a job, you have to re-generate a CON flat file. When calling the BatchRunner component, you can also use the function call syntax: SELECT BatchRunner.MyJob('True' as "-quiet", contract_id as "contract_id") When using this syntax, the job method can be used only if zero or one record is returned and only when the job has exactly one output parameter. |