sdaiValidateAttrType
Note: This function can only be used with the EDMmodelChecker license key fully installed.
Checks that all attribute values in the specified instance are of correct primitive type and correct value according to the attribute definitions in the Express schema that defines the actual attributes.
This operation is applicable only to application instances.
The model that holds the actual instance must be open before this operation can be successfully performed.
Related functions: sdaiValidateInstance , edmiValidateInstance , edmiValidateInstanceType , edmiValidateInstanceTypeBN , edmiValidateModel , edmiValidateModelBN
Header:
#include "sdai.h"
Prototype:
SdaiLogical sdaiValidateAttrType(SdaiAppInstance instance);
Arguments:
instance |
A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase, i.e. the instance to check that all attribute values are of the correct primitive type and correct value according to the attribute definitions in the EXPRESS schema that defines the actual attributes. |
Returns:
A SdaiLogical value that has the following value:
sdaiTRUE : All attribute values in the specified instance are of correct primitive type and of correct value according to the actual attribute definitions in the EXPRESS schema that defines the actual attributes. All mandatory attributes, i.e. attributes that are not declared as OPTIONAL have a correct value assigned. OPTIONAL attribute values may be set or unset, when set the actual value is of correct primitive type and correct value.
sdaiFALSE: At least one of the attribute values in the specified instance have a wrong primitive type or a wrong value according to the actual attribute definitions in the EXPRESS schema that defines the actual attributes.
sdaiUNKNOWN: Use sdaiErrorQuery to check for error in operation.
Examples:
SdaiAppInstance anInst;
SdaiLogical result;
...
result = sdaiValidateAttrType (anInst);
switch (result) {
case sdaiTRUE:
. . . /* No attribute data type violation */
break;
case sdaiFALSE:
. . . /* Attribute data type violation detected */
break;
default:
. . . /* Unset elements or possibly errors in operation */
}
. . .