Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »


 
Invokes the EDMmodelChecker to validate the specified data model against the specified global rule. The specified global rule must be defined in the dictionary model (Express schema) that is the underlying schema of the specified data model, or the global rule must be defined in an EDMruleSchema appropriate to the specified data model.
The actual data model must be open before this operation can be successfully performed.
The expressions logging can be used to log (trace) the execution of the global rule in the EDMexpressVM. The EDMsupervisor and the interactive EDMdebugger can be used for testing and debugging global rules as well as getting detailed information of a validation process.
Related functions: edmiValidateGlobalRuleBN ,edmiValidateGlobalRuleWithParameters, edmiValidateGlobalRuleWithParametersBN, edmiValidateInstance , edmiValidateInstanceWithParameters, edmiValidateInstanceType , edmiValidateInstanceTypeBN ,edmiValidateInstanceTypeWithParameters, edmiValidateInstanceTypeWithParametersBN, edmiValidateModel , edmiValidateModelBN ,edmiValidateModelWithParameters, edmiValidateModelWithParametersBN, edmiValidateWhereRule , edmiValidateWhereRuleBN ,edmiValidateWhereRuleWithParameters, edmiValidateWhereRuleWithParametersBN, sdaiValidateGlobalRule , edmiDefineRuleSchema
Header:
#include "sdai.h"
Prototype:
EdmiError edmiValidateGlobalRule(SdaiModel      modelId,
                                  SdaiGlobalRule globalRuleId, 
                                  SdaiString     userOutputFile, 
                                  SdaiLogical    *result); 
Arguments:

modelId

A numeric modelID that uniquely identifies the data model of interest in the EDMdatabase .
The modelID is returned from the functions: sdaiCreateModel , sdaiCreateModelBN , sdaiOpenModelBN , edmiGetModel , edmiGetModelBN , sdaiGetInstanceModel

globalRuleId

A numeric globalRuleID that uniquely identifies the global rule to validate.

userOutputFile

Specifies the name of a file that will be used to receive the result of executing the xpxPrintf and xpxOutputValue function in the actual global rule. The specified file can be an existing file or the name of a file that will be created by the EDMmodelChecker. The default file extension is ".txt".
The output of the xpxPrintf and xpxOutputValue function in the actual global rule will be written to the EDMinterface current output device when the <userOutputFile> is set to NULL. The EDMinterface current output device can be defined by the edmiDefineOutputFunction operation.

result

Address of a SdaiLogical variable that will receive the result of the validation operation. The returned result is as follows:
sdaiTRUE: No global rule violation.
sdaiFALSE: Actual data model violates specified global rule.
sdaiUNKNOWN: Unpredictable result due to unset values or error in operation. Use sdaiErrorQuery to check for error in operation.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiModel modelId;
SdaiGlobalRule globalRuleId;
SdaiLogical result;
. . .
if (rstat = edmiValidateGlobalRule(
modelId, 
globalRuleId, 
"/usr/hkd/ifc/data/validation_print.text", 
&result)) { 
/* Error in operation */ 
printf("\nError: %s in edmiValidateGlobalRule\n", 
edmiGetErrorText(rstat)); 
goto error; 
}
switch (result) {
case sdaiTRUE: 
. . . /* No violation in operation */ 
break; 
case sdaiFALSE: 
. . . /* Rule violation */ 
break; 
default: 
. . . /* Unpredictable result */ 
break; 
}
. . .

  • No labels