DESCRIPTION: This module tests the various ways in which structures may be archived to and retrieved from external files. In particular, the programs test the effect of various ways of specifying the set of affected structures and the effect of the conflict resolution flags. SEMANTIC REQUIREMENTS:#F 137
SR1. For <archive structures>, the set of structures to be archived in the specified archive file contains exactly those whose identifiers are in the specified list.
#F 138
SR2. For <archive structure networks>, the set of structures to be archived in the specified archive file contains those whose identifiers are in the specified list, and all their descendants in the CSS.
#F 139
SR3. For <archive all structures>, the set of structures to be archived in the specified archive file contains all those currently in the CSS.
*** Logic of archival conflict resolution, *** for each specified structure S: *** *** if (S in CSS) then *** if (S already in archive) then *** if (archival-flag = UPDATE) then *** overwrite S from CSS to archive [SR6] *** elseif (archival-flag = MAINTAIN) then *** no action [SR7] *** elseif (archival-flag = ABANDON) then *** abort, signal error 405 [SR8] *** endif *** else (S not in archive) *** copy S from CSS to archive [SR4] *** endif *** else (S not in CSS) *** no action - signal warning 200 [SR5] *** endif#F 137 138 139
SR4. If a structure S is in the specified set of an archive operation and S exists in the CSS but not in the archive file, then S is copied from the CSS to the archive file.
#F 137 138 139
SR5. If a structure S is in the specified set of an archive operation and S does not exist in the CSS, then S error 200 is signalled and no other action is taken for that structure.
#F 137 138 139
SR6. If a structure S is in the specified set of an archive operation and S exists in both the CSS and the archive file, and the archival conflict resolution flag is UPDATE, then S is copied from the CSS to the archive file, replacing the old structure with the same identifier.
#F 137 138 139
SR7. If a structure S is in the specified set of an archive operation and S exists in both the CSS and the archive file, and the archival conflict resolution flag is MAINTAIN, then no action is taken for S.
#F 137 138 139
SR8. If a structure S is in the specified set of an archive operation and S exists in both the CSS and the archive file, and the archival conflict resolution flag is ABANDON, then the archive file is left in the same state as it was before the operation and error 405 is signalled.
*** *** *** *** *** Retrieving structures *** *** *** *** ***#F 142
SR9. For <retrieve structures>, the set of structures to be retrieved from the specified archive file contains exactly those whose identifiers are in the specified list.
#F 143
SR10. For <retrieve structure networks>, the set of structures to be retrieved from the specified archive file contains those whose identifiers are in the specified list, and all their descendants in the archive file.
#F 144
SR11. For <retrieve all structures>, the set of structures to be retrieved from the specified archive file contains all those currently in that file.
*** Logic of retrieval conflict resolution, *** for each specified structure S: *** *** if (S in CSS) then *** if (retrieval-flag = MAINTAIN) then *** no action [SR14] *** elseif (retrieval-flag = ABANDON) then *** abort, signal error 405 [SR15] *** elseif (retrieval-flag = UPDATE) then *** if (S in archive) *** overwrite into CSS [SR16] *** else (S not in archive) *** overwrite empty S into CSS, warning 408 [SR17] *** endif *** endif *** else (S not in CSS) *** if (S in archive) then *** copy S from archive to CSS [SR12] *** else (S not in archive, nor in CSS) *** create empty S in CSS, warning 408 [SR13] *** endif *** endif#F 142 143 144
SR12. If a structure S is in the specified set of a retrieve operation and S exists in the archive file but not in the CSS, then S is copied from the archive file to the CSS.
#F 142 143 144
SR13. If a structure S is in the specified set of a retrieve operation and S exists in neither the archive file nor in the CSS, then an empty structure with identifier S is created in the CSS and warning 408 is signalled.
#F 142 143 144
SR14. If a structure S is in the specified set of a retrieve operation and S exists in the CSS and the retrieval conflict resolution flag is MAINTAIN, then no action is taken for S.
#F 142 143 144
SR15. If a structure S is in the specified set of a retrieve operation and S exists in the CSS and the retrieval conflict resolution flag is ABANDON, then the CSS is left in the same state as it was before the operation and error 405 is signalled.
#F 142 143 144
SR16. If a structure S is in the specified set of a retrieve operation and S exists in both the CSS and the archive file, and the retrieval conflict resolution flag is UPDATE, then S is copied from the archive file to the CSS, replacing the old structure with the same identifier.
#F 142 143 144
SR17. If a structure S is in the specified set of a retrieve operation and S exists in the CSS and but not in the archive file, and the retrieval conflict resolution flag is UPDATE, then an empty structure with identifier S is created in the CSS replacing the old structure with the same identifier and warning 408 is signalled.
#F 142 143 144
SR18. Whenever an open CSS structure is to be overwritten by a retrieve operation, it is first closed, overwritten, and then re-opened, implying that the element pointer indicates the last element of the structure.
#F 142 143 144
SR19. Whenever a completed retrieve operation has introduced into the CSS a reference to a non-existent structure, then an empty structure is created with the corresponding identifier.
LOCAL DICTIONARY:
Functions --- 137: parst <archive structures> 138: parsn <archive structure networks> 139: parast <archive all structures> 142: prest <retrieve structures> 143: presn <retrieve structure networks> 144: prast <retrieve all structures> Data Structures --- 4 ... phigs_state_list 4.3 ... element_pointer 4.7 ... archival_conflict_resolution_flag 4.8 ... retrieval_conflict_resolution_flag 7 ... structure_state_list 7.1 ... structure_identifier 7.3 ... list_of_structure_elements 7.3.4 ... execute_structure 9 ... archive 9.1 ... archive_file 9.1.1 ... structure_identifier 9.1.2 ... list_of_structure_elements 9.1.2.4 ... execute_structure LOCAL SUBROUTINES: AVARNM returns an available name for a new archive file. CSSIDS checks the actual set of structure identifiers in the CSS against an expected list, encoded as a string. If equal, it returns true, else false. RETOPN checks that the state of the open structure is as expected and issues pass or fail as a result. If there is an open structure, it is closed by RETOPN
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.
You may inspect either the design or code for this program.