menu_banner (2K)

Appendix E: Multiple Tasks for a single Script

The task identities on the MENU database are different from the names of the scripts which are actually executed. This allows me to do the following:

The ability to run the same script from more than one task is a useful feature when coupled with the ability to specify different parameters for each task (refer to Appendix D). In this way you can set up different tasks which run the same script but with different runtime parameters.

For example, the contents of the TASK table can be quite large, and sometimes there is a need to search where TASK_TYPE='MENU' while at other times there is a need to search where TASK_TYPE='PROC'. In a less flexible system this could only be achieved by creating totally different scripts for each task, but as the differences between these scripts is so minor they can be covered by specifying different task parameters for the same script. I have a single script which shows the contents of the TASK table, but it is accessed by several tasks:

List Task (all) This has the following parameter values:
  • Initial Passthru=mnu_task(search)
  • Selection (fixed)=

This will automatically activate task mnu_task(search) on initial entry, but will not include any fixed selection criteria.

List Task (proc) This has the following parameter values:
  • Initial Passthru=mnu_task(search)
  • Selection (fixed)=task_type='PROC'

This will automatically activate task mnu_task(search) on initial entry, and will restrict the selection to those entries where task_type='PROC'.

List Task (menu) This has the following parameter values:
  • Initial Passthru=
  • Selection (fixed)=task_type='MENU'

This will not activate any other task on initial entry, but will restrict the selection to those entries where task_type='MENU'.


http://www.tonymarston.net
http://www.radicore.org

counter