Debugging an Expression


Before registering virtual attributes, measurement points, or metrics, you can use the expression debugging tool to validate and debug the data expressions to ensure the successful registration of virtual data.

Prerequisites


You need to be assigned the required asset permission and operation permission, and a menu group containing the Expression Debug menu. If not assigned, contact the application administrator.

Procedure


  1. Select Tools > Expression Debug from the left navigation pane.
  2. Common Data Service provides various expression templates for typical scenarios. You can perform the following actions on the target template in the Expression Template section:
    • Click Copy Copy in the Template Content column, and paste the template content into the expression input box.
    • Click Insert in the Operation column and the template content will be added to the expression input box.
  3. Combine and adjust the expression in the expression input box as needed and click Validate. If the validation fails, adjust the expression according to the error message until it prompts “Validation succeeded”.
  4. Once the validation succeeds, all the parameters in the expression are displayed in the list in the Configure Parameters section. Each column represents a parameter, and each row represents a set of parameter values.
  5. Select the data type of the parameter values in the drop-down box under each parameter, and the default data type is Double. If a parameter value has been filled, the data type cannot be modified.
  6. Fill in the parameter values ​​as required in the input box under each parameter. You can add more parameter value sets by clicking Add Parameter Instance, clear all parameter values by clicking Clear All, and view the aggregated debugging results of all parameter value sets by checking Display Aggregated Debugging Results.
  7. Click Debug and the results are displayed in the Expression Debugging Results column. If the debug fails, click the tip icon Tip to view the error message and modify the parameter values until the debugging result is displayed normally.