If the custom check you have defined supports an automatic correction, you can type the body of this function in the Autofix Script tab of the custom check properties.
The autofix is visible in the Check Model Parameters dialog box, it is selected by default if you select the Execute the Automatic Correction by Default check box in the General tab of the custom check properties.
By default, the Autofix Script tab displays the following script items:
%Fix% is the function name, it is passed on parameter obj. It is displayed as a variable, which is a concatenation of the name of the resource file, the name of the current metaclass, the name of the stereotype or criterion, and the name of the fix. If any of these names contains an empty space, it is replaced by an underscore
The variable outmsg is a parameter of the fix function. You need to specify the fix message that will appear when the fix script will be executed
The return value line that indicates if the fix succeeds or not
We will use the same example as in section Defining the script of a custom check, to define an autofix script that removes the columns with incorrect data type from index.