This section describes in some detail all the utility packages used in the Oracle Reconstruction rules.  A more in depth look at the packages' implementation is found in the 'package name'.txt files.  Note that all these packages are case insensitive (as far as arguments, parameters, package name, etc.).

Package CONFIG.
---------------

The CONFIG package controls all the mission configuration parameters used by the Reconstruction rules.  These parameters are stored in a table called CONFIG_PARM, loaded during the installation of the Reconstruction rules.  The config package is used by LabView's Graphical User Interface to easily manipulate configuration parameters.  It may also be used by mission analysts to change configuration parameters in an interactive Oracle SQLPLUS session as the following examples illustrate. 

  Specifications for package CONFIG.
  ----------------------------------

  Function  get (parm in varchar2)
            Return varchar2;

    Example:   exec dbms_output.put_line (config.get ('TOL_QA_AFST')).

    Note that if the configuration parameter sought is a number, the 
    config.get function will return the a character string converted
    to a number.  "parm" represents the parameter being sought.
    Should one attempt to get the value of a parameter that does
    not exist or that has been misspelled, the following error 
    message will be outputted: THERE IS NO CONFIGURATION PARAMETER
    FOR "TOL_QA_AFST".

  Procedure change (parm in varchar2,
                    setting in varchar2);

    Example:   exec config.change ('TOL_QA_AFST','900');

    In the above example, the parameter TOL_QA_AFST is changed from its
    previous value to 900.  "parm" represents the parameter being 
    changed, and "setting" represents the value "parm" is being changed
    to.  Should one attempt to change a parameter that does not exist,
    the following error message will be outputted:  THERE IS NO 
    CONFIGURATION PARAMETER FOR "TOL_QA_AFST".

  Procedure add (parm in varchar2,
                 setting in varchar2);

    Example:   exec config.add ('HIP HIP HOURRAH',1000);

    In the above example, the parameter "HIP HIP HOURRAH" is created
    assigned the value 1000.  "parm" represents the parameter being
    created and "setting" is the value assigned to "parm".

  Procedure remove (parm in varchar2)

    Example:   exec config.remove ('HIP HIP HOURRAH');

    In the above example, "parm" represents the parameter being 
    removed.  "HIP HIP HOURRAH" is dropped from the parameter list.

  Procedure show_all;
  
    Example:   exec config.show_all;

    Note that this procedure takes no arguments and the outcome of its
    execution is the display of all the mission configuration parameters
    in a formatted output.

Package SWITCH.
---------------

The SWITCH package controls all the switch settings for all the Oracle Reconstruction rules, all of which mayeither be turned off (switch = 0) or on (switch = 1).  Through the switch package mission analysts may alter the execution paths of the Reconstruction rules to obtain a desired product.  The switch settings for all rules are stored in table RECON_SWITCHES.  The SWITCH package is used by LabView's Graphical User Interface to easily allow switches manipulations.  Mission analysts may also manipulate rules' switches during an interactive Oracle SQLPLUS session as the following examples illustrate.

  Specifications for package SWITCH.
  ----------------------------------

  Function get (rule in varchare)
                return number;
                
    Example:   exec dbms_output.put_line (switch.get('RECONSTRUCTION1'));

    "rule" is the name of the Reconstruction rule.  In the above example, 
    the switch for rule "RECONSTRUCTION1" is being sought and the value 
    returned is either a 1 or a 0.  Should one attempt to get the switch
    for a rule that does not exist or that has been misspelled, the
    following error message will be outputted: THERE IS NO SWITCH FOR
    RULE "RECONSTRUCTION1".  
                  
  Procedure change (rule in varchar2,
                    setting in integer);

    Example:   exec switch.change ('LOG_FILE',0);
    
    "rule" is the name of the Reconstruction rule, and "setting" is the
    switch setting for the rule.  In the above example LOG_FILE is a 
    that is being turned off.  Should one attempt to change a parameter
    that does not exist, the following error message will be outputted:
    THERE IS NO SWITCH FOR RULE "RECONSTRUCTION1".

  Procedure add (rule in varchar2, setting in integer);

    Example:   exec switch.add ('HIP HIP HOURRAH',0);

    In the above example, the newly created rule "HIP HIP HOURRAH" is
    being turned off.  "rule" is the name of the Reconstruction rule,
    and "setting" is the switch setting for the rule.

  Procedure remove (rule in varchar2);
  
    Example:   exec switch.remove ('HIP HIP HOURRAH');

    "rule" is the name of the Reconstruction rule.  In the above example
    "HIP HIP HOURRAH" is being dropped from the switch settings after 
    having been dropped from the rules list (with package RULE).

  Procedure show_all;

    Example:   exec switch.show_all;

    Note that this procedure takes no arguments and the outcome of its
    execution is the display of all the display of all the Reconstruction
    rules switch settings in a formatted output.
    
Package RULE.
-------------

The RULE package controls the numbering order of the rules when they have been created or when they have beendropped.  During operations a reconstruction rule may be created to handle a special characteristic of the data of a mission.  In the event of the latter, the RULE package is used to assign a number to the newly created rule, in the Reconstruction rules hierarchy, number which is based on exactly before or after which rule will the new addition be executed.  Similarily, should mission analysts decide to drop a rule, the RULE package is used to re-number the rules and define the new hierarchy automatically.  The numbers for all rules are stred in the RULES_NUMBERS.  The RULE package is used by LabView's Graphical User Interface to easily allow rules numbers manipulations.  Mission analysts may also manipulate rules' numbers during an interactive Oracle SQLPLUS session as the following examples illustrate.  


  Specification for package RULE.
  -------------------------------

  Function get_num (rule in varchar2)
                    return number;
                   
    Example:   exec dbms_output.put_line (rule.get_num('RECONSTRUCTION1'));

    "rule" is the name of the Reconstruction rule.  In the above example
    the number for rule RECONSTRUCTION1 is being sought.  Should one
    attempt to get a number for a rule that does not exist or that has
    been misspelled, the following error message will be outputted:  
    THERE IS NO RULE NUMBER FOR RULE "RECONSTRUCTION1".
                   
  Function get_name (num_in in integer);
                     return varchar2;
                    
     Example:   exec dbms_output.put_line (rule.get_name(68));
                   
     "num_in" is the number for the rule whose name is being sought.  In
     the above example the name or rule number 68 is being sought.  Should
     one attempt to pass in as argument a number for which there is no 
     rule, the following error message is outputted: THERE IS NO RULE
     FOR RULE_NUMBER 68.  

  Procedure change (rule in varchar2, setting in number);

    Example:   exec rule.change ('RECONSTRUCTION1',45);

    "rule" is the name of the Reconstruction rule, and "setting" is the
    switch setting for the rule.  In the above example RECONSTRUCTION1
    is being re_numbered to 45.  Should one try to change the number of
    a rule that does not exist of which name has been misspelled, the
    following error message is outputted: RULE "RECONSTRUCTION1" WAS
    NOT FOUND IN THE DATABASE.  Shoud one re_number a rule to a value
    equal to its previous value, the followind message is outputed:
    NO CHANGE MADE BECAUSE LAST RULE NUMBER IS THE SAME AS NUMBER
    REQUESTED.  

  Procedure add (rule in varchar2, setting in number);

    Example:   exec rule.add ('HIP HIP HOURRAH',39);

    "rule" is the name of the Reconstruction rule, and "setting" is the
    switch setting for the rule.  In the above example, the newly created
    rule "HIP HIP HOURRAH" is being assigned the number 39.  The rule
    previously numbered 39 will now become rule 40 and all other numbers
    thereafter will be increased by 1.

  Procedure remove (rule in varchar2)

    Example:   exec rule.remove ('HIP HIP HOURRAH')

    "rule" is the name of the Reconstruction rule.In the above example
    "HIP HIP HOURRAH" is being dropped from the list of rules in used.

  Procedure to_file (increment in number);

    Example:   exec rules.to_file (1);

    The purpose of this rule in the RULE package is to allow the analysts
    to keep track of the Oracle Reconstruction rules version changes.  The  
    The convention is that at installation, the rules are given a version
    1.00.  Whenever the states within a rule are changed (for example more
    states may be added) the analyst must record the new version of the
    rule by executing this procedure with an increment argument of .01.  
    The latter execution will cause the version of the rules to increment
    by the specified value and the new rules settings, states description
    and versions will be written to a file for tracking.  More information
    on the latter is given in the specification of the STATES package.

    If a rule, is dropped, added or has its number changed mission analysts
    must run this procedure, passing it an argument of 1 (rules version
    will increment by one) to write all changes to a file for tracking.
    Note that this procedure should be called not after every change in 
    the rules numbering of states addition or deletion, but after all 
    intended modification are done in one sitting and before the next 
    reconstruction session.  

    The location and file name of where the rules numbers and versions will  
    be written to are parameterized in the "OUTPUT_FILE_LOCATION" and 
    "VERSION_LOG" configuration parameter respectively, controllable through 
    the CONFIG package or through the LabView configuration Graphical User 
    Interface. 

    Note that procedure to_file also timestamps the changes as they are
    being written to file.
    
  Procedure show_all;

    Example:   exec switch.show_all;

    Note that this procedure takes no arguments and the outcome of its
    execution is the display of all the display of all the Reconstruction
    rules names and associated numbers in a formatted output.

Package STATES.
---------------

   Specification for package STATES.
   ---------------------------------

   Procedure to_file (file_name in varchar2);

   Example:   exec states.to_file (config.get ('VERSION_LOG'));

   Note that it is by no accident that the states package contains only
   one procedure.  This packaged could easily be made to provide more 
   functionalities like show all the states for a particular rule, a rule
   number, or even a range of rule numbers.  
   
   Precedure to_file writes all the states information for all the rules
   to a file for easy documentation.  "file_name" is the name of the file
   in which the version will be logged.  The directory where the latter 
   file will be created is controlled by the configuration parameter
   "OUTPUT_FILE_LOCATION" which can be manipulated through the CONFIG
   package or through the LabView configuration Graphical User Interface.
   
   In the above example rather than simply providing a file name such as
   'states_file.txt' as argument, a Reconstruction parameter was passed in
   though the CONFIG package, VERSION_LOG, which is the name of the file 
   which stores all the version changes made to the rule, changes which may 
   be triggered by a state change or a rule number change.

   Procedure to_file used the ALL_STATES table to pull information from.
   after a an update of the states of a rule, or after a new rule's states
   have been added in the ALL_STATES table, this procedure may be ran
   as shown in the example prior to have ran rule.to_file with the appro-
   version increment.  This assures that the Reconstruction rules can be
   kept track of, and when a state has been updated, all states are recorded
   in the same files as the rules, rules, numbers and version numbers for 
   easy bookeeping.
