Files Rules Option


The Rules option from the Files/Fields screen accesses the File Level Event Points for Rules overlay shown in Figure 2-4-3 below. This overlay provides options to access the ILF Editor for APPX event points. If statements are defined in an event point, the respective text on the screen is highlighted. This option allows you to define ILF code that is executed whenever the designated file is accessed or updated in any APPX process.

Figure 2-4-3. File-Level Event Points for Rules Overlay

The File Level Event Points for Rules overlay contains the following options:

File Open

file open accesses the ILF editor for the File Open event point. Upon completion, you are returned to the Event Points overlay. This code is executed whenever the file is opened by a process.

Post Read

post read accesses the ILF editor for the Post Read event point. Upon completion, you are returned to the Event Points overlay. This code is executed immediately following the execution of a read statement on the file (READ, READNEXT, or BEG READ) or automatic read of the file when designated as a PCF file.

Pre-Update

pre-update accesses the ILF editor for the Pre-Update event point. Upon completion, you are returned to the Event Points overlay. This code is executed immediately prior to the issuance of an update statement on the file (WRITE, REWRITE or DELETE) or automatic update of the file when designated as a PCF file.

Post Update

post update accesses the ILF editor for the Post Update event point. Upon completion, you are returned to the Event Points overlay. This code is executed immediately following the execution of an update statement on the file (WRITE, REWRITE or DELETE) or automatic update of the file when designated as a PCF file.

File Close

file close accesses the ILF editor for the File Close event point. Upon completion, you are returned to the Event Points overlay. This code is executed whenever the file is closed by a process.

Using file-level event points localizes complex update rules into a single location, assuring that your code executes for every update. Since these event points execute within the context of a file-level process, they share very little data with other processes. In fact, the only thing shared between a file-level process and the “foreground” process is the PCF record buffer. For example, in the Post Read event point, you have access to the contents of the record just retrieved. If changes are made in the record buffer, those changes are reflected in the foreground process. In the Pre-Update event point, you have access to the PCF record buffer as delivered by the foreground process. File-level event points use their own copies of work variables so even work fields are not shared with other processes.

To create file level event points, simply select the option corresponding to the desired execution point. See the Event Points and File-Level Event Points sections for further information.