IBM Curam KeyServer Generation


This tutorial aims to explain KeyServer generation technique for unique value for a specific column for one or more tables. Curam provides a technique to generate unique IDs across the application tables based on KeyServer name. The goal is to generate unique numbers wherever they are being used, to avoid potential ID conflicts.

Example: CaseHeader table uses KeyServer Technique for various column like CASEID, CASEREFERENCE etc.

Please find steps to implement KeyServer and its uses below –

  • We need to add entry in dmxfile which is located underEjbServer/Component/Custom/data/initial/KeyServer.dmx locationSample code is provided below –

  <table name="KeyServer"> 
  <column name="keySetCode" type="text"/>
  <column name="nextUniqueIdBlock" type="id"/>
  <column name="humanReadable" type="bool"/>
  <column name="lastUpdated" type="timestamp"/>
  <column name="Annotation" type="text"/>
  <attribute name="keySetCode">
    <attribute name="nextUniqueIdBlock">
    <attribute name="humanReadable">
    <attribute name="lastUpdated">
    <attribute name="Annotation">
        <value>Keyset for Provider Referral Reference Number</value>

above, we added KWPROVIDERREF new KeyServer entry and will use to get unique reference number/ID.

  • We need to write Java implementation to use above created KeyServer so we can make sure newly created KWPROVIDERREF entry is being used. Source Code snippet is available below –

UniqueID uniqueIDObj = UniqueIDFactory.newInstance();
UniqueIDKeySet uniqueIDKeySet = new UniqueIDKeySet();
uniqueIDKeySet.keySetName = "KWPROVIDERREF";
String providerReferenceNumber = Strig.valueOf(uniqueIDObj.getNextIDFromKeySet(uniqueIDKeySet));

System.out.println("providerReferenceNumber :"+providerReferenceNumber);

Leave a Reply

Your email address will not be published. Required fields are marked *