14 Customizing Object Validation Requirements

This chapter contains the following topics:

About Customizing Object Validation

You can use a package called CDR_DF_CUSTOM_VALIDATION to set your own standards for object definitions.

The internal procedures createNaming and modifyNaming call this package each time a user creates or modifies an object definition or instance and commits the changes. By default, the package returns a value of True and the standard application logic for creating or updating an object proceeds.

However, you can modify this package to enforce your own rules—for example, naming conventions—so that the package returns False and displays an error message if one or more rules are violated. The operation fails and the system does not invoke the standard application logic for creating or updating an object.

You can set a rule for any attribute of any object type (not just the name). You can set different rules for different object types.

To see all attributes for all object types predefined in the Oracle Life Sciences Data Hub (Oracle LSH), enter the following query at a SQL prompt:

desc apps.cdr_naming_version_obj_type

Modifying the Custom Validation Package

The CDR_DF_CUSTOM_VALIDATION package contains one procedure: validateNaming.

The procedure looks like this:

 PROCEDURE validateNaming(
        pi_oNamingVersionObjType IN CDR_NAMING_VERSION_OBJ_TYPE,
        po_bRetStatus OUT NOCOPY BOOLEAN,
        po_vRetMsg OUT NOCOPY VARCHAR2 )

It uses the following parameters:

pi_oNamingVersionObjType

is an input parameter for the object type being validated. See the table cdr_naming_version_obj_type for the internal name of each object type.

po_bRetStatus

is an output parameter with a Boolean return: True if all rules are satisfied, False if one or more rules are violated. By default this parameter value is hardcoded to True.

po_vRetMsg

is an output parameter that supplies the text of the error message to be displayed in the user interface if a new or modified object does not pass one or more validation requirements defined in this procedure.