| Oracle Repository API and Model Reference Guide |
A 'dangling reference' is one whose target does not exist or is outside an assumed context (context is one of workarea, configuration, container, or arbitrary set of objects).
Note: A reference in this sense is a relationship implemented via a reference property in the object concerned, and does not include the notion of containership, which is implemented via FOLDER_MEMBERs.
The JR_CHECK_REFS package provides the following methods for identifying dangling references:
check_refs - Check an arbitrary set of PAC elements.
check_cfg_refs - Check all elements in a configuration.
check_fol_refs - Check all elements in a container.
check_wa_refs - Check all elements in a workarea.
check_elem_refs - Check a specific element for unresolved references in the context workarea.
Note: JR_NUM_LIST and JR_STR_LIST are global data types available to all API callers.
Callers need the SEL access right on the context (workarea, container, or configuration) to be checked.
For details of the various access rights and system privileges, see The Privileges and Access Rights API.
PROCEDURE jr_check_refs.check_refs(elem_ivids IN JR_NUM_LIST
, elem_types IN JR_NUM_LIST
, check_el IN JR_STR_LIST
, el_irid OUT JR_NUM_LIST
, el_ivid OUT JR_NUM_LIST
, ref_irid OUT JR_NUM_LIST
, el_par_irid OUT JR_NUM_LIST
, el_par_ivid OUT JR_NUM_LIST
, ref_par_irid OUT JR_NUM_LIST
, el_type OUT JR_STR_LIST
, el_typ_sname OUT JR_STR_LIST
, ref_type OUT JR_STR_LIST
, ref_typ_sname OUT JR_STR_LIST
, ref_par_sname OUT JR_STR_LIST
, ref_prop OUT JR_STR_LIST
, mandatory OUT JR_STR_LIST
, reason OUT JR_STR_LIST);
Where:
elem_ivids is an array of IVIDs of PAC elements that constitute a set.
elem_types is an array of element type IDs, each referring to the corresponding entry in elem_ivids.
check_el indicates, for each entry in elem_ivids, whether to check that PAC for references outside the set.
For each element found to have external references, and for each such reference, the following is returned:
el_par_ivid on return from the call, contains the IVID of the parent of the referring element. If the element is a PAC, then el_par_ivid is the same as el_ivid.
el_type_sname the short name for the referring element's type.
ref_type_sname the short name for the referenced element's type. If the element is a PAC, ref_type_sname is the same as ref_par_sname.
ref_par_sname the short name for the type of the parent of the referenced element.For details of other parameters, see Parameters.
Checks for dangling references outside a set of elements defined by the contents of the elem_ivids array.
For each entry in check_el that contains a 'Y', it checks if the corresponding entry in elem_ivids references any entry outside the set. If so, it returns in el_irid and el_ivid the IRID and IVID respectively of the refererring element, and also returns in other parameters information about the referenced element. For details of the other parameters, see Parameters.
PROCEDURE jr_check_refs.check_wa_refs(workarea_id IN NUMBER
, el_ivid OUT JR_NUM_LIST
, ref_irid OUT JR_NUM_LIST
, el_par_ivid OUT JR_NUM_LIST
, ref_par_irid OUT JR_NUM_LIST
, el_type OUT JR_STR_LIST
, ref_type OUT JR_STR_LIST
, ref_prop OUT JR_STR_LIST
, mandatory OUT JR_STR_LIST
, reason OUT JR_STR_LIST);
Where:
workarea_id is the ID of the workarea to be checked.
For details of other parameters, see Parameters.
Checks for dangling references in the context of the specified workarea.
PROCEDURE jr_check_refs.check_cfg_refs(config_id IN NUMBER
, el_ivid OUT JR_NUM_LIST
, ref_irid OUT JR_NUM_LIST
, el_par_ivid OUT JR_NUM_LIST
, ref_par_irid OUT JR_NUM_LIST
, el_type OUT JR_STR_LIST
, ref_type OUT JR_STR_LIST
, ref_prop OUT JR_STR_LIST
, mandatory OUT JR_STR_LIST
, reason OUT JR_STR_LIST);
Where:
config_id is the IVID of the configuration to be checked.
For details of other parameters, see Parameters.
Checks for dangling references in the context of the specified configuration.
PROCEDURE jr_check_refs.check_fol_refs(container_id IN NUMBER
, recurse IN BOOLEAN
, el_ivid OUT JR_NUM_LIST
, ref_irid OUT JR_NUM_LIST
, el_par_ivid OUT JR_NUM_LIST
, ref_par_irid OUT JR_NUM_LIST
, el_type OUT JR_STR_LIST
, ref_type OUT JR_STR_LIST
, ref_prop OUT JR_STR_LIST
, mandatory OUT JR_STR_LIST
, reason OUT JR_STR_LIST);
Where:
container_id is the the IVID of the container to be checked.
recurse if TRUE, specifies that sub-containers of container_id are to be checked.
For details of other parameters, see Parameters.
Checks for dangling references in the in the context of the specified container. A context workarea must be set.
PROCEDURE jr_check_refs.check_elem_refs (elem_irid IN NUMBER
, elem_ivid IN NUMBER
, elem_type IN NUMBER
, el_ivid OUT JR_NUM_LIST
, ref_irid OUT JR_NUM_LIST
, el_par_ivid OUT JR_NUM_LIST
, ref_par_irid OUT JR_NUM_LIST
, el_type OUT JR_STR_LIST
, ref_type OUT JR_STR_LIST
, ref_prop OUT JR_STR_LIST
, mandatory OUT JR_STR_LIST
, reason OUT JR_STR_LIST);
Where:
elem_irid is the IRID of the element to be checked.
elem_ivid is its IVID.
elem_type is its type ID.
For details of other parameters, see Parameters.
Checks the single specified element for any references that are unresolved in the current context workarea.
Can be used for PACs or SACs. A context workarea must be set when calling this method.
For PACs only, elem_ivid and elem_type can be NULL.
The methods:
The remaining parameters are parallel indexed arrays (nested tables), each containing, on return, an equal number of entries, as follows:
el_irid contains a list of IRIDs, the object versions that reference objects outside the specified context (workarea, configuration, container, or set).
el_ivid contains a list of IVIDs, the object versions that reference objects outside the specified context (workarea, configuration, container, or set).
ref_irid contains a list of IRIDs, the objects outside the specified workarea that are referenced by object versions in the context.
el_par_ivid is the IVID of the parent of each of the corresponding el_ivids. If el_ivid is a SAC, the corresponding el_par_ivid is its owning PAC. If a PAC, then el_par_ivid is a repeat of the corresponding el_ivid.
ref_par_irid is the parent of the corresponding ref_irid. If ref_irid is a SAC, the corresponding ref_par_irid is its owning PAC. If a PAC, then ref_par_irid is a repeat of the corresponding ref_irid.
el_type is the NLS display name of the element type to which the corresponding el_ivid belongs.
ref_type is the NLS display name of the element type to which the corresponding ref_irid belongs.
ref_prop is the NLS display name of the property linking the corresponding el_ivid and the corresponding ref_irid.
mandatory is one of:
- 'Y' - the corresponding reference property is mandatory
- 'N' - the corresponding reference property is optional.
reason indicates why the corresponding reference is being treated as a dangling reference, and is one of:
- 'ACCESS' - The corresponding ref_irid is in the context, but the caller does not have SEL access right on it.
- 'CONTEXT' - ref_irid is not in the workarea specified by workarea_id.
- 'REPOSITORY' - The corresponding ref_irid is not in the repository. In this case, corresponding entries in the other arrays might not be useful.
- 'VERSION' - The context contains a version of the parent PAC that does not include the SAC element. So the remedy is not just to include the parent into the context, but to include an appropriate version on the parent, that is, a version of the PAC that includes the SAC in its definition.
- 'WASTEBASKET' - The referenced element is in the wastebasket of the current context workarea.
- 'WORKAREA' - (Applies to check_fol_refs only) The referenced element is not only outside the context of the specified folder, it is outside the context of the entire workarea.
Note: In the set of nested tables used by these methods, each 'row' describes a single occurrence of a reference. Therefore, the same el_irid or el_ivid can appear multiple times.