Decisions Example 3: Starting Multiple Batch Jobs

Previous Next

See Also

This decision executes a USoft Batch job for each pending project from within an online application by retrieving project codes that correspond to an on-screen value. Typically, the Scheduled flag will be set to 'N' by a SQL task at the end of the batch job. The batch job could be an export job, in which case the decision could be called from a "Generate Updated Flat Files" menu option.

Decision SQL

SELECT p.project_code

FROM   project p , destination d

WHERE  p.destination = d.destination

AND    d.destination_id = :"query.destination_id()"

AND    p.scheduled = 'Y'

Yes Action

ActionStartJob('PROJECT_PROGRESS_REPORT', FORMULA(':1 || :2', *'PROJECT_CODE=', :1))

The job is started as many times as there are rows retrieved by the Decision SQL statement. For each row, the retrieved project_code is passed to the job as a parameter.

No Action

MessageInformation('No jobs scheduled at this time.')