Creating and Editing a Unique Key

You can create unique keys designed to ensure that two objects cannot be saved with the same values for a set of chosen attributes.

Note: To activate a unique key, see Manage Packages: Activating a Unique Key.

This task shows you how to:


Before you begin: You must have created a deployment package.

Create a Unique Key

You can create a unique key to make sure that two objects cannot be saved with the same values for a set of chosen attributes.

Note: Unique Key names shall contain alphanumeric characters and the "_" character only.

  1. In the Model Customization app, click Categories and select Unique Keys.
  2. In the Unique Keys tab, click New Key .
    The Create New Unique Key window opens.
  3. Define the unique key.
    1. Enter the key name in the Name box.
    2. In the Types box, click ... to display the Types List. This list shows the types to which the key can be applied.
    3. In the Types List window, click one of the types and click Submit.
    4. Select a type extension to be constrained by the key.
    5. Click Done when you are finished with the key creation.
      The key appears in the Unique Keys List window.
      • Name corresponds to the key name.
      • Constrained Type (Owner Package) shows the package containing the type constrained by the key.
      • Constrained Extension (Owner Package) shows the list of the constrained extensions.

Notes:
  • Attributes can be taken from the type and/or the extension, if any. A unique key can also constraint some basic attributes such as revision, owner, originated.
  • The attributes constrained by the unique key are those that are checked.
  • The unique key is only applied to objects that have the type extension you specified in step 3.d. To automatically add a type extension to an object, either select true from the Automatic addition list when creating a deployment extension, or create a business rule. For more information, see Creating and Deleting a Deployment Extension and Creating a Business Rule.

Edit a Unique Key

You can remove an attribute from the unique key.

  1. Select the check box located next to the Attribute you want to delete.
  2. Click Modify List of Constrained Attributes .
    The attribute is removed.

Delete a Unique Key From the User Interface

You can delete a unique key provided it is not activated. if it is, deactivate it first, then delete it.

In the Unique Keys tab, select the unique key and click Delete .

Delete a Unique Key Using a Shell Script

You can delete a unique key using the CustoDataTool2.sh shell script even if it is activated.

Note: When the -deleteAbsent argument is declared, the metadata file is imported and all missing entities are deleted.

Open a command window and enter the following command: <intall_directory>/server/scripts/CustoDataTool2.sh -file on Unix andCustoDataTool2.bat on Windows.
For example, enter CustoDataTool2.sh –password creatorPassword -file /tmp/CustoPackage.zip –deleteAbsent.