Code Block | ||||
---|---|---|---|---|
| ||||
FUNCTION xpfValidateModelBNxpfValidateModelWithParameters (repositoryIdmodelId : GENERIC; modelName, diagnosticFile : STRING; options : INTEGER; ruleSchemaName ruleSchemaId : STRINGGENERIC; userOutputFile : STRING; VAR validationResultsId validationResultId : GENERIC; VAR returnValue : GENERIC; numberOfParameters : INTEGER; argument1, ... , argumentN : GENERIC) result : LOGICAL; |
The xpfValidateModelBN function validates a model, i.e. checks that the attribute values of all instances in the model do not violate any of the constraints/rules defined in their corresponding entity definitions.<repositoryId> The id. of the repository containing the model to be checked.<modelName> Name of the model to be checked.The rest of the arguments are identical to those of xpxValidateInstance.This function invokes the EDMmodelChecker to validate all instances of the specified instance type in the specified data model. When the XPXSUBTYPES is set in the options argument, all instances in the actual model that are subtypes of the specified type, will be validated as well. The result of the validation can be a text report, a population of the Express schema EDM_Validation_Result_Schema or both. A population of the EDM_Validation_Result_Schema enables the caller to make his own diagnostic report in his own format. There exist two options that will influence the amount of information in the validation report produced by this function: XPXNO_PRINT_OUTPUT and XPXFULL_OUTPUT A standard validation report will be produced when none of these options are set in the <options> argument. A validation report with all available detailed information is produced when the XPXFULL_OUTPUT option is set. No validation report will be produced when the XPXNO_PRINT_OUTPUT option is enabled. The validation result would then normally be in a population of the EDM_Validation_Result_Schema.
When validating an instance against rules specified in an EDMruleSchema, only he following validation options are effective: XPXFULL_VALIDATION, XPXGLOBAL_RULES, XPXLOCAL_RULES, XPXUNIQUENESS_RULES. XPXFULL_VALIDATION means in this context: XPXGLOBAL_RULES ~| XPXLOCAL_RULES ~| XPXUNIQUENESS_RULES . A number of arguments can be supplied to the ?instance type validation process? in the arguments argument1, ?, argumentN. Hence the validation process can be made parameterized. The validation process can return a value to the caller through the returnValue argument. The value to return must be set in the validation process by invoking the xpxReturnValueToCaller operation. This function is only applicable to application instances. The data model that holds the instance to validate must be open before this operation can be successfully performed.
See related functions: xpxGetNumberOfUserParameters, xpxGetUserParameter
Arguments
...
Type | Name | Comment | |||
GENERIC | repositoryIdmodelId | A A numeric Id that uniquely identifies the repository model in the EDMdatabase that holds the model of interest. | STRING | modelName | Specifies the name of the data model to validate. Model names are case sensitive. The combination of the arguments <repository> and <modelName> uniquely identifies a model in the EDMdatabase . |
STRING | diagnosticFile | Specifies the file name for diagnostic information generated by this function. If no file name is supplied, i.e. the <diagnosticFile> argument is set to NULL, all diagnostic information will be written to the current output device. | |||
INTEGER | options | see below | |||
STRING | ruleSchemaName | Specifies ruleSchemaId | A numeric Id that uniquely identifies the name of the EDMruleSchema to use in the validation operation. Rule schema names are case insensitive. The rules and constraint defined in the dictionary model (Express schema) that is the underlying schema of the specified data model will be validated when <ruleSchemaName> = NULL. | ||
STRING | userOutputFile | Specifies the name of a file that will be used to receive the result of executing the xpxPrintf and xpxOutputValue function during the validation operation. | |||
GENERIC | validationErrorId | The address of a variable of type GENERIC that will receive a numeric instanceID that uniquely identifies an instance of type validation_error in a population of the EDM_Validation_Result_Schema that contains all details of the violations detected in the last invocation of the EDMmodelChecker. No population of the EDM_Validation_Result_Schema will be produced when the <validationErrorId> argument is NULL on input. | |||
GENERIC | returnValue | ||||
INTEGER | numberOfParameters | Number of arguments to be sent to the validation process | |||
GENERIC | argument(n) | Arguments to be sent to the validation process |
Return Value
...
Type | Name | Comment |
STRINGLOGICAL | resultStringresult | comments |
Options
...
Option | Comment |
---|---|
xpxFULL_VALIDATION | Specifies that the actual instance will be validated against all rules and constrains that is applicable for this particular instance. When the argument <ruleSchemaId> is specified unequal to zero, this options means the following options: |
xpxGLOBAL_RULES | Specifies that all global rules appropriate for the specified instance will be validated. These global rules are defined in the appropriate dictionary model (Express schema) or defined in the specified EDMruleSchema. |
xpxLOCAL_RULES | Specifies that all local rules (Where rules) appropriate for the specified instance will be validated. These local rules are defined in the appropriate dictionary model (Express schema) or defined in the specified EDMruleSchema. |
xpxINVERSE_RULES | Specifies that all Inverse constraints defined for the actual instance will be validated. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxUNIQUENESS_RULES | Specifies that all Uniqueness rules defined for the actual instance will be validated. |
xpxREQUIRED_ATTRIBUTES | Specifies that all mandatory attributes, i.e., all explicit attributes that are not declared to be OPTIONAL, of the instance will be checked for an assigned value, i.e., checked that the attribute values are set. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxATTRIBUTE_DATA_TYPE | Specifies that all attribute values of the instance will be checked for legal data type. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxAGGREGATE_DATA_TYPE | Specifies that all element values in all aggregates owned by the specified instance will be checked for legal data type. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxAGGREGATE_SIZE | Specifies that the number of elements in all aggregates owned by the specified instance is according to the related aggregate declarations. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxARRAY_REQUIRED_ELEMENTS | Specifies that all elements in arrays, that are not declared as OPTIONAL, owned by the instance, will be checked for an assigned value, i.e., checked that no unset elements exists. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxAGGREGATE_UNIQUENESS | Specifies that all aggregates owned by the specified instance will be validated for uniqueness violation. Aggregates that have an uniqueness constraints are all SET aggregates, and ARRAY and LIST aggregates that are declared with the optional keyword UNIQUE. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxUNSET_DERIVE_ATTRIBUTES | Specifies that warnings will be issued if unset derived attributes are found. This option is not applicable when the argument <ruleSchemaId> is set unequal zero. |
xpxOUTPUT_STEPID | Specifies that the stepID corresponding to the instanceID will be written to the validation report when the actual correspondence exists in a STEP Identifier model. |
xpxFULL_OUTPUT | Specifies that all available information about the source of the errors will be recorded in the diagnostic report from this command. |
xpxSTOP_ON_FIRST_ERROR | Specifies that the validation process should terminate when the first error is detected. |
...
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|
SYNTAX:
The argument <options> specifies the options that should be used during the validation. The <options> argument should be specified as a bitwise OR of one or more of the following integer constants:
XPXFULL_VALIDATION XPXAGGREGATE_DATA_TYPE
XPXGLOBAL_RULES XPXAGGREGATE_SIZE
XPXLOCAL_RULES XPXARRAY_REQUIRED_ELEMENTS
XPXINVERSE_RULES XPXAGGREGATE_UNIQUENESS
XPXUNIQUENESS_RULES XPXOUTPUT_STEPID
XPXREQUIRED_ATTRIBUTES XPXFULL_OUTPUT
XPXATTRIBUTE_DATA_TYPE XPXSTOP_ON_FIRST_ERROR
This function is equivalent to the EDMinterfaceTMfunction edmiValidateModelWithParameters.