Service Registry 3 2005Q4 Developer's Guide

Adding External Identifiers to Objects

To add an external identifier to an object, follow these steps:

  1. Find or create the classification scheme to be used.

  2. Create an external identifier using the classification scheme.

To create external identifiers, you use an external classification scheme, which is a classification scheme without a concept hierarchy. You specify a name and value for the external identifier.

The database that is supplied with the Registry does not include any external classification schemes. Before you can use an external classification scheme, you must create it, using code like the following:


ClassificationScheme extScheme =
     blcm.createClassificationScheme("NASDAQ",
         "OTC Stock Exchange");

To find an existing classification scheme, you typically call the BusinessQueryManager.findClassificationSchemeByName method, as described in Adding Classifications to Objects.

For example, the following code fragment finds the external classification scheme you just created:


ClassificationScheme extScheme =
     bqm.findClassificationSchemeByName(null,
         "NASDAQ");

To add the external identifier, you call the LifeCycleManager.createExternalIdentifier method, which takes three arguments: the classification scheme and the name and value of the external identifier. Then you add the external identifier to the object.


ExternalIdentifier extId =
     blcm.createExternalIdentifier(extScheme, "Sun",
         "SUNW);
object.addExternalIdentifier(extId);

The example <INSTALL>/registry/samples/publish-object/src/JAXRPublishObject.java, described in Adding Classifications: Example, also adds an external identifier to an object.