Custom Checks (Profile)

Custom checks define additional rules to validate the content of your models. The logic of the check is defined using VBScript. Custom checks appear alongside standard checks in the Check Model dialog.

Custom checks appear with standard model checks in the Check Model Parameters dialog (see Core Features Guide > Modeling with PowerDesigner > Objects > Checking Models).
  1. Right-click a metaclass, stereotype, or criterion, and select New > Custom Check.
  2. Enter the following properties as appropriate:

    Parameter

    Description

    Name

    Specifies the name of the custom check, which is displayed under the selected object category in the Check Model Parameters dialog. This name is also used (concatenated) in the check function name to uniquely identify it.

    Comment

    Provides a description of the custom check.

    Help Message

    Specifies text to display in the message box that opens when the user right-clicks the check and selects Help.

    Output message

    Specifies text to display in the Output window during check execution.

    Default severity

    Specifies whether the check is designated by default as an error (major problem that stops generation) or a warning (minor problem or just recommendation).

    Execute the check by default

    Specifies that the check is selected by default in the Check Model Parameters dialog.

    Enable automatic correction

    Specifies that an autofix is available for the check (see Example: PDM Autofix).

    Execute the automatic correction by default

    Specifies that the autofix is executed by default.

  3. Click the Check Script tab and enter your script (see Example: PDM Custom Check. You can access shared library functions and static attributes defined for reuse in the resource file from the Global Script tab (see Global Script (Profile)).


  4. If you want to define an autofix, click the Autofix Script tab and enter your script (see Example: PDM Autofix.
  5. Click Apply to save your changes.
    All custom checks defined in any resource files attached to the model are merged and all the functions for all the custom checks are appended to build one single script. You custom checks are displayed in the Check Model Parameters dialog box alongside the standard model checks. If there are errors in your custom check scripts, the user will be prompted with the following options:
    • Ignore- Skip the problematic script and continue with the other checks.
    • Ignore All - Skip this and any future scripts with problems and continue with the other checks.
    • Abort - Stop the model checking.
    • Debug - Stop the model checking and open the Resource Editor on the script line with the problem.