Extensions

This chapter covers the following topics:

Administering Extensions

Extend the Oracle Trading Community Architecture (TCA) Registry by creating an unlimited number of user-defined attributes. TCA extensions use the extensibility framework and features from Oracle Product Hub. See: User-Defined Attributes, Oracle Product Hub User's Guide.

You can create groups of extended attributes for these objects, the TCA entities:

Associate functions and actions with attribute groups to use custom logic and determine end user interaction. Assign attribute groups to pages so that the attributes are displayed in specific UI pages.

Note: TCA extensions administration does not use the PLM security model or TCA Data Sharing and Security. TCA attributes that you extend can be used only in Oracle Customers Online.

If you also use profile versioning, schedule programs to periodically synchronize the extensions data with organization or person profile records. See: Copying Extensions Data for Profile Versioning.

Related Topics

Extensions Process

Extensions Example

Introduction to Administration

Extensions Process

Prerequisites

Create detailed plans of user-defined attributes and their usage in user interfaces, as well as any functions.

Procedure

  1. Select the entity that you want to extend.

  2. Value Sets: Create value sets for attributes validation, if needed. See:

    • Creating Value Sets, Oracle Product Hub User's Guide

    • Defining Table Value Sets, Oracle Product Hub User's Guide

    • Creating Independent Values, Oracle Product Hub User's Guide

  3. Attribute Groups: Create the attribute group and add attributes to the group, including any corresponding value sets. See: User-Defined Attributes, Oracle Product Hub User's Guide.

    Important: The Product Hub view and edit privileges are not used for extending TCA attributes.

    Note: After you save attributes, you cannot change the data type. You also cannot delete the attributes from the TCA Registry. You can, however, disable them so that they are not displayed in user interfaces.

  4. Functions: Define functions, if needed. See: Creating User-Defined Functions, Oracle Product Hub User's Guide.

    To add parameters to the function after it is created, click the name of the function in the main Functions page. You open the function details, which includes parameters and usages.

  5. Associations: Click Add Attribute Groups and select the group, with the entity as the data level. This association is needed before you can assign the groups to pages.

    If needed, back in the main Associations page, click Update Actions for the attribute group and create actions to link functions to the attribute group and entity combination. After the action is created, map function parameters to attributes by clicking the action name in the Actions page. You open the action details, including the function mappings.

    Important: The PIM security privileges are not used for extending TCA attributes.

  6. Pages: Create a page and add the attribute group for the group to be used in user interfaces that leverage the page.

Note: The attribute group and page are automatically associated with the Administrator Defined classification.

Related Topics

Administering Extensions

Extensions Example

Extensions Example

You need to store eye color, hair color, and body measurements for persons in the TCA Registry, for a UI in which users can update person profiles. You also need to let users calculate the body mass index based on the entered weight and height.

Prerequisites

  1. Plan out the attributes, including data type, range of values, specific values, and UI display method. These tables show the planning for this example.

    Physical Characteristics Attribute Group
    Attribute Data Type Values Range Values Display Required
    Eye Color Character None
    • Black

    • Brown

    • Blue

    • Green

    • Violet

    List of Values No
    Hair Color Character None
    • Black

    • Brown

    • Blonde

    • Gray

    • Red

    • Other

    List of Values No
    Body Measurements Attribute Group
    Attribute Data Type Values Range Values Display Required
    Height Number 1 - 100 None Text No
    Weight Number 1 - 1000 None Text No
    Body Mass Index Number 1 - 100 None Text No
  2. Plan out the function and action for calculating the body mass index. This table shows the questions and answers for this example.

    Question Answer for This Example
    Which attributes are functions of other attributes? The Body Mass Index attribute is a function of the Height and Weight attributes.
    What type of function is this: Java, PL/SQL, or URL? PL/SQL.

Procedure

  1. Select Person Profiles as the entity to extend.

  2. Create value sets for the attributes. This table shows what you define for this example.

    Value Set Name Data Type Maximum Size Validation Type Display Type Value Range
    EyeColor Char 6 Independent List of Values Not Applicable
    HairColor Char 6 Independent List of Values Not Applicable
    Height Number 3 None <Not Applicable> Minimum Value: 1
    Maximum Value: 100
    Weight Number 4 None <Not Applicable> Minimum Value: 1
    Maximum Value: 1000

    This table shows what you add as specific values for the HairColor value set. You would accordingly enter values for EyeColor, based on your plan.

    Value Enabled Sequence Start Date
    Black Yes 1 <System date>
    Brown Yes 2 <System date>
    Blonde Yes 3 <System date>
    Gray Yes 4 <System date>
    Red Yes 5 <System date>
    Other Yes 6 <System date>
  3. Create the attribute groups. This table shows what you define for this example.

    Internal Name Display Name Multi-Row
    PHYSICAL_CHAR Physical Characteristics No
    BODY_MEASURE Body Measurements No

    Add attributes to each group, as presented in these tables.

    Attributes in Physical Characteristics Attribute Group
    Internal Name Display Name Sequence Data Type Column Enabled Required Display As Value Set Default Value
    EYE_COLOR Eye Color 1 Char C_EXT_ATTR1 Yes No Text Field EyeColor Brown
    HAIR_COLOR Hair Color 2 Char C_EXT_ATTR2 Yes No Text Field HairColor Brown
    Attributes in Body Measurements Attribute Group
    Internal Name Display Name Sequence Data Type Column Enabled Required Display As Value Set Default Value
    HEIGHT Height 1 Number N_EXT_ATTR1 Yes No Text Field Height None
    WEIGHT Weight 2 Number N_EXT_ATTR2 Yes No Text Field Weight None
    BMI Body Mass Index 3 Number N_EXT_ATTR3 Yes No Text Field None None
  4. Create a function to calculate the body mass index.

    1. Write the custom PL/SQL for the calculation. For this example:

      PACKAGE XX_EXT_TEST AS
        FUNCTION CALC_BMI
          (p_weight in NUMBER,
           p_height in NUMBER)
        RETURN NUMBER;
      END XX_EXT_TEST;
      
      PACKAGE BODY XX_EXT_TEST AS
        FUNCTION CALC_BMI
          (p_weight in NUMBER,
           p_height in NUMBER)
        RETURN NUMBER
        IS
          l_bmi number;
        BEGIN
          l_bmi := trunc((p_weight*703) / (p_height*p_height));
          dbms_output.put_line('BMI = '||l_bmi);  -- for testing
          return l_bmi;
        END;
      END XX_EXT_TEST;
      
    2. Run the PL/SQL package in your custom schema and create a synonym for this package in the APPS schema.

    3. Define the function in the extensions administration.

      • Internal Name: CALC_BMI

      • Display Name: Calculate BMI

      • Function Type: PL/SQL

      • Package: XX_EXT_TEST

      • Procedure: CALC_BMI

    4. Enter function parameters as shown in this table.

      Sequence Internal Name Display Name Data Type Parameter Type
      1 p_weight Weight Number Input
      2 p_height Height Number Input
      3 x_bmi Body Mass Index Number Return Value
  5. Add both attribute groups and associate them with the Person Profiles data level.

    For the Body Measurements attribute group, create an action for calculating the body mass index:

    • Sequence: 1

    • Action Name: Calculate BMI

    • Function: Calculate BMI

    • Execution Method: User Action

    • Display Style: Button

    • Prompt Application: Customers Online

    • Prompt Message Name: XX_CALC_BMI_MSG

      Note: You need to define the message to use as the prompt, in this case, the text that appears on the button. See: Define Your Messages, Oracle E-Business Suite Developer's Guide.

    • Visible: Yes

    Important: The PLM security privileges are not used for extending TCA attributes.

    Map the function parameters to attributes, as shown in this table.

    Parameter Name Mapped To Mapped Attribute
    Weight Attribute Group Weight
    Height Attribute Group Height
    Body Mass Index Attribute Group Body Mass Index
  6. Create a page and assign both attribute groups to it. For this example, you enter:

    • Display Name: Person Physical Information

    • Internal Name: PERSON_PHYSICAL_INFO

    • Sequence: 10

    • Data Level: Person Profiles

    • Attribute Groups

      • Sequence: 10, Display Name: Physical Characteristics

      • Sequence: 20, Display Name: Body Measurements

Related Topics

Administering Extensions

Extensions Process

Copying Extensions Data for Profile Versioning

Use the Copy Organization Extensions Data for Profile Versioning and Copy Person Extensions Data for Profile Versioning programs to synchronize organization or person profile extensions with the corresponding party profile records.

If the HZ: Profile Version Method for Updates profile option is set to New Version or One Day Version, when party profiles are updated, the existing profile record can be set with an end date, and a new profile record created with the newly entered information. In the extensions tables, the programs copy extensions data associated with the old profile ID and create new rows associated with the new profile record.

For example, the old organization profile ID is 123, and there are five rows in the HZ_ORG_PROFILES_EXT tables with extended attribute values for that profile. For those five rows, the ORGANIZATION_PROFILE_ID column value is 123. The user updates the profile record and creates a new version with identifier 456. The extensions data, however, is still linked to record 123. When the Copy Organization Extensions Data for Profile Versioning program runs, it copies the extensions data for 123 and creates new extensions records with ORGANIZATION_PROFILE_ID column as 456.

If the profile option is set to New Version or One Day Version, run these programs after:

You do not need to run these programs when party profiles are directly updated through the user interface in any application.

Prerequisites

Program Parameters

Related Topics

Administering Extensions