3.20.1 The Chicken and the Egg Situation
This situation may arise when setting up a series of file definitions that refer to one another. Consider the following file definitions that are to be set up using LANSA:
FILEA: has a validation rule that references FILEB. FILEB has an access route to FILEC.
FILEB: has batch control logic that references FILEA, which has an access route to FILEA. FILEA has an access route to FILEC.
FILEC: has a validation rule that references FILEB, which has an access route to FILEA. FILEA has an access route to FILEB.
If we begin to set up FILEA using LANSA it will not be possible to specify the validation rule that references FILEB because FILEB does not exist yet. Likewise the access route to FILEC cannot be specified because FILEC does not exist yet.
The chicken and egg situation is this: FILEA cannot be set up because it references FILEB ... and FILEB cannot be set up because it references FILEA.
The solution:
- Define the fields and logical views of FILEA, FILEB and FILEC as required.
- Use the appropriate menu option to make the file definitions operational.
- Amend the definitions of FILEA, FILEB and FILEC. It should now be possible to specify the validation rules, access routes and batch control logic because all the files are operational.
- Use the appropriate menu option to make the amended file definitions operational. In all cases only the I/O modules will be recompiled because no actual changes to the fields in the file or the logical views have been made.