Modify Model(s) in Digital Twin for one Litmus Edge
To modify Model(s) with Litmus Excel Add-ins, you should be familiar with how Models work in Digital Twins on Litmus Edge.
Before You Begin
- You have installed the Litmus Excel Add-ins extension. See Install Litmus Excel Add-ins for details.
Initial Preparation
Open a new DT Model Management Tool File in Excel.
If prompted, Enable Content to allow the code to run.

Make sure the the tool is set Connect To is set to One LE.

Modify Models(s)
Import Model(s)
Import the Model Settings for Model(s) defined on Litmus Edge using the Import Model(s) Wizard.

Users can set a filter to reduce the number of Module(s) shown as selection to the user.
- Search Option: Select what type of filter is to be used
- Model Name Mask: Set the filter to be applied. Will be ignored if Search Option is set to ALL
- The wizard will show what filter will be applied.

- Press the Search button to pull the filtered List of Model(s) from Litmus Edge.

- The user will be shown the filtered List of Model(s) matching their filter.

- Select the Model(s) to import and press the Import button.

Notes:
Users can choose between:
- Press New Search to set another filter and search again if the list doesn't show the Model(s) the user wanted to import
- Select All Model(s) using the Checkbox in the Header Row.
- Select a Group of Model(s) by selecting their respective Check Box
- Select one Model by selecting the respective Check Box
- Select No Model and close the Wizard pressing the Close button instead.
- The selected Model(s) with their settings are imported into the sheet. Once finished, the user can either.
- perform another search using the New Search button
- finsih the import using the Close button

- The Action for each imported tag is set to M for modify.

Mandatory Model Settings
Users can modify these mandatory settings for a Model(s).
Model Name: The Name of an existing Model can be changed.
Important: This will change the topic for the Instances of this model and will cause other services like Analytics, Integrations or Flows not be able to read the data
Model Definition Properties are a mandatory set of Model Settings, which are required for defining the Digital Twin Model Data structure.
- Static Attributes: Static Attributes allow to manage the metadata for the model. This column combines all of these as a single JSON Object. It is recommended to use the Static Attributes Wizard when setting your specific values for Static Attributes.

- Transformations: Transformations allow to define how to transform the data collected in instances by converting raw JSON data to a desired format by defining the JSON-based schema by the model . This column combines all of these as a single JSON Object. It is recommended to use the Transformations Wizard when setting your specific values for Transformations.

- Dynamic Attributes: Dynamic Attributes allow to manage variable data in the model. This column combines all of these as a single JSON Object. It is recommended to use the Dynamic Attributes Wizard when setting your specific values for Dynamic Attributes.

- Model Schema: Model Schema allows to create a custom data structure for the model. This column combines all of these as a single JSON Object. It is recommended to use the Model Schema Wizard when setting your specific Model Schema.

Not Mandatory Model Settings
- Model Description: Enter a short description of the model in the Description field
- UNS Enabled: Select if you want to enable Litmus UNS for the Model.
- UNS Connector: If Litmus UNS Connector(s) are defined for the Litmus Edge, select which Litmus UNS Connector to use to populate the Static Attributes with the Litmus UNS Hierarchy.

Notes:
Selecting an UNS Connector will automatically modify the respective Static Attributes associated with the UNS Connector as well as adding them to the Model Schema under the metadata folder by default.
Before changing UNS Connector:

After changing UNS Connector:

Notes:
You can repeat modifying mandatory and not mandatory Model settings for every Model you need to modify before executing Actions.
Executing Actions
When all mandatory and not mandatory settings for all Model(s) are set they are ready to be modified.
It is Recommended but not mandatory to verify the configuration first without executing the Action by pressing the Verify Only button.

This will check that all required Model Settings are provided and logically correct. And provide any finding to the user. Example: Below the user not select a UNS Connector despite having enabled UNS in column UNS Enabled.

Important: The tool can not verify if all provided Model settings are factually correct. For example it can not verify that the value of a Static Attribute is correct for what the user want to achieve.
The Model(s) can be modified to Litmus Edge by pressing the Verify + Execute button.

This will check that all required Model Settings are provided and logically correct. And provide any finding to the user. If no issues have been identified, the tool will verify that the user wants to execute ALL the actions from the Action Column:
- A: Add Model(s)
- M: Modify Model(s)
- D: Delete Model(s)
- I: Ignore Model(s) -> do nothing
To perform all actions, press the Yes button.

The Tool will perform ALL Actions row by row. When finished, a result Summary is shown. Close the Result Summary by pressing the X close button.

The tool will ask if the user wants to re-compare the Model(s) against Litmus Edge. To re-compare, press the Yes button. To not re-compare, press the No button.

If the User selected to press the Yes button from aboves messagebox, the tool will pull all the Model settings from Litmus Edge again including the ModelID and also change the Action to M for each Model with a ModelID or A forModel with no ModelID.

Troubleshooting
The Tool will perform several checks throughout the proces of defining the Model settings. If they do not pass successfully, the user will be notified. The checks include:
- Model Name uniqueness on a Litmus Edge level.
- The tool checks if a Model Name already exist for a specific Litmus Edge in the Tool.

- The user is shown a message box as notification.

- The character(s) are highlighted in red and also shown in a note.

- See Allowed and not allowed Ascii Characters for Names and Descriptions for a full list for both Names and Descriptions.
- Correct JSON formating for Static Attributes, Trasnformations, Dynamic Attributes and Model Schema.
- Example for an invalid JSON formatting of the Static Attributes

- While it is possible to not define entries for the columns Static Attributes, Trasnformations, Dynamic Attributes and Model Schema, the tool verifieds if any of these columns are empty. As this will cause Instances of this model to not return data or not return expected data.

- While it is possible to leave some Values for Static Attributes and Dynamic Attributes empty, the tool checks for such empty values. As this will cause Instances of this model to not return data or not return expected data. Example: No SchemaID defined for Dynamic Attribute.
