Job Methods

Previous Next

See Also

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:

Seqno

Parameter Name

Mode

Mandatory

Datatype

Details

1

pk

out

Yes

String

 

2

output column 1

out

Yes

Integer

 

3

output column 2

out

Yes

Integer

 

4

-quiet

in

No

Boolean

Details

5

-[<set>:]string_delimiter

in

No

String

Details

6

-[<external set>:]colsep?

in

No

String

Details

7

-[<external set>:]nvl

in

No

String

Details

8

-[<task_name>:]data_directory

in

No

String

Details

9

-[<task_name>:]create_suc

in

No

Boolean

Details

10

-[<task_name>:]create_err

in

No

Boolean

Details

11

-[<task_name>:]create_mes

in

No

Boolean

Details

12

-[<task_name>:]

filename::<old_file_name>

in

No

String

Details

13

-[<task_name>:]

user_table::<old_table_name>

in

No

String

Details

14

<input_parameter_set.element>

in

No

?

 

15

,,

,,

,,

 

 

 

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.