Logic is validated using the Validate command.
One of the following procedures can be used to validate logic:
To validate a single method, initiate Logic Editor for the desired method, then from the Build menu, select Validate.
To validate an entire entity, select the desired entity in the Class view, Members list, or Logic Status list; then from the Build menu, select Validate. Alternatively, right-click the desired entity in the Class view, Members list, or Logic Status list; then select Validate < element Name >.
Logic is first saved and validated. Errors, if any, are displayed in the Error list. The number of errors found is displayed on the Microsoft Visual Studio status bar.
Customize the behavior of the Validate command using the Options command from the Tools menu. Refer to Setting Validation Options for more information.
The Validate command can also be executed using a command line interface. The following command line syntax is used for validating the elements in a model:
Validate {/m <modelname> | /p <projectfile>} {/n <elementname>[;<elementname>...] | /f <filename>} [/s <databaseinstance>] [/tr [<threadcount>]] [/r]
Where:
Parameter | Description |
---|---|
{} | Denotes that at least one argument must be chosen from the arguments within the braces. The arguments are separated by the vertical bars (|). |
[] | Denotes an optional argument. |
/m or /M <modelname> | Identifies the name of the model database to be used. Note: You must use either the /m or /p parameter. |
/p or /P <projectfile> | Identifies the name of the project file to be validated. This field must include full path and the project file name and file extension. Note: You must use either the /p or /m parameter. |
/n or /N <elementname> | Identifies the qualified element names separated by comma. The default value is the model node name. Note: You must use either of /n or /f parameter. |
/f or /F <filename> | Identifies the name and path of the file holding a list of fully qualified names to be validated. Note: You must use either of /f or /n parameter.
|
/s or /S <databaseinstance> | Identifies the database instance with the model database. This is a optional parameter. |
/tr or /TR <threadcount> | Identifies the number of threads to be validated. This is an optional parameter. |
/r or /R | Reset validation status for all logics to force revalidation. This is an optional parameter. |
For help on these parameters, enter Validate /? at the command prompt.
If you want to capture output to a file for logging purposes, use the following command as an example:
Validate /m meta /s serverA /f c:\temp\input.txt >> c:\temp\validate.txt
One or more of the following output messages might be produced:
Message Type | Message |
---|---|
Error | Fatal Error: <exception message> |
Error | Model <ModelName> not found on Server <ServerName> |
Error | Model or Project name missing |
Error | Project file <ProjectName> not found, check name and path. |
Error | Cannot open file <FileName>, error = <ErrorCode> |
Error | No parameter |
Error | Invalid parameter |
Error | Model name missing |
Error | Server name missing |
Error | File name missing |
Message Type | Message |
---|---|
Informational | >>> START validate of <FileNameEntry> |
Informational | Element: <ElementName>, Validate completed UNSUCCESSFULLY |
Informational | Element: <ElementName>, Validate completed SUCCESSFULLY |
Informational | Element: <ElementName> not found in Model |
Informational | Element: <ElementName>, is external and cannot be validated. |
Informational | Element: <ElementName>, Validate FAILED |
Informational | Element: <ElementName>, Found no elements to validate |
Informational | <TotalElementCount> Element(s) validate <TotalErrorCount> in error |
Informational | >>> END validate of <FileNameEntry> |
With Informational messages, the processing continues by reading next record from the file specified by the “/f” parameter.
Any Error messages prevent completion of the operation.
Note: You can cancel validation using the Cancel button, which is part of the Build/ Compile button group.