Automatic and Optional Child Invocations


A child process is the process that is invoked from another process (the parent). The invocation of a child process from the parent process can be automatic or optional.

If invocation of a child is not discretionary on the part of the application user, the child process is an automatic child. Automatic children are related to a frame, and are always invoked by APPX after processing the images for that frame. Input, output, update, job, and inquiry processes are the only process types that support automatic children. Menu, query, status, and subroutine processes do not.

If invocation of a child is discretionary on the part of the application user, the child is an optional child. Optional children can only be invoked from interactive images in menu and input processes. They are related to an image, and only invoke if a user selects the options that identify them. A traditional menu image, for example, contains one option for each process you can select from the menu, as shown in Figure 3-1-5.

Figure_3-01-05.png

Figure 3-1-5. A Menu's Optional Children

Table 3-1-2 illustrates the types of processes that can be used to invoke children. As shown, optional children can be invoked from menu and input processes while automatic children can be invoked from job, input, output, update, and inquiry processes. Query, status, and subroutine processes cannot be used to invoke children of any kind.

Process Type

Optional Children?

Automatic Children?

Menu

Yes

 

Job

 

Yes

Input

Yes

Yes

Output

 

Yes

Update

 

Yes

Query

 

 

Inquiry

 

Yes

Status

 

 

Subroutine

 

 

Table 3-1-2. Combinations of Process Type/Child

You can establish selection criteria to restrict the PCF records that APPX accesses for an automatic or optional child. For example, you can use selection criteria to constrain a line item process, so only those line items that belong to the current order are accessed. In this case, the selection criteria require that the line item order number in the child process is equal to the order number in the parent process. See Chapter 3-13: Automatic and Optional Children for a detailed discussion of various options.

Invocation Types

The way a child process is invoked from its parent establishes the boundaries of shared information between the two processes. In other words, the parent process uses the value in an Invocation Type specification to define how tightly coupled the child is to the parent. It governs the information that can be passed and shared between processes. Whether or not a specific item of information is passed or shared depends upon pass and share specifications entered in the data dictionary, or defined explicitly with statements.

There are three distinct invocation types: subprocess, related, and detached (in order from most to least tightly coupled). If you use the data dictionary default values and do not explicitly pass information with statements, the various invocation types function as follows:

·    A child invoked as a subprocess shares record areas, file position information (for READNEXT operations, among others), and the contents of both permanent and temporary files with the process it was invoked from.

·    A child invoked as a related process shares the contents of permanent and temporary files with the process it was invoked from. It does not share file position information, and it maintains its own record area in memory.

·    A child invoked as a detached process shares only the contents of any permanent files.

Refer to Chapter 1-5: Interprocess Communication for a complete discussion of detached, related, and subprocess files and processes.