Precisely Enterworks

 View Only
  • 1.  Auto Generated UUID as Primary Key

    Posted 23 days ago

    We are creating some new repositories for purposes such as item Events or metadata management, and would like to set the repository Primary Key to a UUID, but beyond VTL based rules and Change Notification, there does not appear to be a way to generate a UUID in the same manner as a Sequence Number is generated.

    I wanted to confirm if there is or isn't native functionality that could populate a Primary Key attribute with a UUID upon creation of a record.



    ------------------------------
    Matthew Hounslow
    Lululemon USA Inc.
    ------------------------------


  • 2.  RE: Auto Generated UUID as Primary Key

    Employee
    Posted 20 days ago

    Matthew,

    There is NOT a native functional capability to populate a Primary Key attribute with a UUID upon creation of a record.  Your alternative choices are:

    • Implement a VTL rule (the Apache Velocity String tool has a generateUUID method and the java.util.UUID class should be accessible.  Keep in mind that the preSave VTL rule (which is recommended over the VTL-Like rule) is always executed, so the script would need to have some conditional logic and only generate if the key attribute is empty.
    • Implement a Change Notification rule in CN_Registry and CN_Transformation_Registry.  Have the CN_Registry rule only fire on creation and when the key is empty, then have the CN_Transformation_Registry rule use the NEWID() function in SQL.
    • Implement a Java-based PreSave Validation rule.  This requires the most work, including generating a JAR file and deploying it to the EnterWorks environment.



    ------------------------------
    Brian Zupke
    *Precisely Software Inc.
    ------------------------------