{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":36815,"path":"operational-technology/operational-technology-manager/create-use-ot-device-naming-strategy.md","title":"Create and use an OT device naming strategy","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create and use an OT device naming strategy\n\nCreate and use the Operational Technology \\(OT\\) device naming strategy to create unique names for your OT devices.\n\n## Before you begin\n\nRole required: cmdb\\_ot\\_admin and script\\_include\\_admin\n\n## About this task\n\nThe Industrial Core plugin comes with the **DeviceNamingStrategyHelper** script include, which identifies whether or not to use the device naming strategy. If yes, then the script identifies which naming strategy to use for a given source class. This helps reduce the number of changes that are required for the Service Graph Connector.\n\n## Procedure\n\n1.  Create an OT device naming strategy.\n\n    1.  Switch the **Application scope** from **Global** to the application that you want to create a device naming strategy for.\n\n    2.  Navigate to **All** &gt; **System Extension Points** &gt; **Scripted Extension Points**.\n\n    3.  Search for and open the **OTDeviceNamingStrategyExtPoint** extension point.\n\n    4.  Select the **Create Implementation** related link.\n\n        A script include is created in the application scope you're in.\n\n    5.  Update the **Name** field to a unique name that indicates what type of naming strategy the created script defines.\n\n        **Note:** Ensure you keep the name unique across all Service Graph Connectors as the name is visible in the Class Mapping table form view when you select an existing script from the list of available strategies.\n\n    6.  In the **Script** field, implement the **calculateDeviceName** function.\n\n        Make sure the function returns a string value. You have access to the jsonObj parameter, which is an object with information provided by the caller.\n\n    7.  Select **Update**.\n\n2.  Use an OT device naming strategy.\n\n    1.  Switch the **Application scope** from **Global** to the application that you want to make changes for.\n\n    2.  Identify the logic where the device name is being calculated.\n\n    3.  Initialize the helper script include with your SGC-specific class mapping table name.\n\n        The **OTDeviceNamingStrategyHelpercontains** helper script include contains functions that can identify the correct implementation for the given source class and can calculate the device name.\n\n    4.  Prepare the data that's required for the device name to be calculated based on the naming strategy that you defined.\n\n        The calculateDeviceName function expects following parameters.\n\n        |Parameter|Description|\n        |---------|-----------|\n        |sourceClassName|Source class name. Ensure the name is in the same format as defined in the Class Mapping table.|\n        |jsonObj|Any attributes that you want to pass to the implementation. You can use this in the implementation script include.|\n\n    5.  Call the **calculateDeviceName** function of the helper script include.\n\n    6.  Ensure you have a fallback mechanism for calculating the device name.\n\n        In cases where there was an error in calculating the device name using the naming strategy, the helper script returns device name as an empty string. Additionally, in a case where no device naming strategy is defined, a default device naming logic is required.\n\n    7.  Run the device import for your Service Graph Connector to verify whether the changes are working as expected.\n\n\n**Parent Topic:**[Industrial Core plugin](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/operational-technology/operational-technology-manager/industrial-core-plugin.md)\n\n"}}