ConvertToHash function - HxGN SDx - Update 63 - Administration & Configuration

Administration and Configuration of HxGN SDx

Language
English
Product
HxGN SDx
Search by Category
Administration & Configuration
SmartPlant Foundation / SDx Version
10

The ConvertToHash function can be used to generate a unique hash code for objects when you have case-sensitive data in your CSV file, but you are exporting to a case-insensitive database. The ConvertToHash function takes the input string and returns a capitalized hash value using the Secure Hash Algorithm 1 (SHA-1) algorithm.

For a given object, the SHA-1 algorithm consistently returns a unique alpha-numeric value known as the hash code for that object.

For example, you may have two company names in your CSV file, ABC Industries and Abc Industries, each with different capitalizations. If you are exporting the CSV file to a case-insensitive database, the export will fail. In this case, you can use the ConvertToHash function to map the ConvertToHash computed column to the SPFCaseSensitiveHashCode property for the object.

func.ConvertToHash(“ABC Industries”) returns 170C0B71E9F68CC294A6614BAE3E7347C208EA48

func.ConvertToHash(“Abc Industries”) returns 98761FC6EB12227F5367A34379998F8055373E1A

Mappings for new and existing objects

Two separate schema files are delivered with Data Validator, which you can load into the system using the Loader. They can be found on Smart Community. For more information, see Find sample data on Smart Community.

  • ISPFCaseSensitiveObject.xml – Comprises the interface definition, ISPFCaseSensitiveObject, and the property definition, SPFCaseSensitiveHashCode.

  • HelperSchema-To-Imply-ISPFCaseSensitiveObject.xml – This is a sample file to optionally imply and realize the class definitions that require the hash value. You can specify the object class definitions and interface definitions in this file and load it.

  • During import mapping, you must select the ISPFCaseSensitiveObject optional interface for the object and the ConvertToHash computed column must be mapped to the SPFCaseSensitiveHashCode property.

  • For new objects, the target system query definition in the export mapping must be defined as.SPFCaseSensitiveHashCode.

  • For existing ojects, the target system query definition in the export mapping can be defined as .Name. The query definition can be changed to .SPFCaseSensitiveHashCode after all the objects in the database are assigned the hash code.