Invokes the EDMmodelChecker to validate the specified instance against the specified local rule (Where rule). The specified local rule must be defined in the dictionary model (Express schema) that is the underlying schema of the data model that hosts the actual instance, or the local rule must be defined in an EDMruleSchema specified in the <ruleSchemaId> argument.
The data model that hosts the specified instance must be open before this operation can be successfully performed.
The expressions logging can be used to log (trace) the execution of the local rule in the EDMexpressVM. The EDMsupervisor and the interactive EDMdebugger can be used for testing and debugging local rules as well as getting detailed information of a validation process.
Related functions: edmiValidateWhereRule , edmiValidateWhereRuleWithParameters, edmiValidateWhereRuleWithParametersBN, edmiValidateGlobalRule , edmiValidateGlobalRuleBN , edmiValidateGlobalRuleWithParameters, edmiValidateGlobalRuleWithParametersBN, edmiValidateInstance , edmiValidateInstanceWithParameters, edmiValidateInstanceType , edmiValidateInstanceTypeBN , edmiValidateInstanceTypeWithParameters, edmiValidateInstanceTypeWithParametersBN, edmiValidateModel , edmiValidateModelBN , edmiValidateModelWithParameters, edmiValidateModelWithParametersBN, edmiDefineRuleSchema
Header:
#include "sdai.h"
Prototype:
EdmiError edmiValidateWhereRuleBN(SdaiAppInstance instance,
SdaiString whereRuleName,
SdaiRuleSchema ruleSchemaId,
SdaiString userOutputFile,
SdaiLogical *result);
Arguments:
instance |
A numeric instanceID that uniquely identifies the instance in the EDMdatabase to be validated. This instanceID is returned when the actual instance is created or it can be retrieved by an EDMinterface get operation. |
whereRuleName |
The name of the actual local rule (Where rule) to validate. Where rule names are case insensitive. When the <whereRuleName> is not unique within the specified instance, then the <whereRuleName> should be qualified with the name of the entity or defined type that declares the actual where rule. |
ruleSchemaId |
A numeric ruleSchemaID that uniquely identifies the rule schema instance in the EDMdatabase that defines the local rule specified in the <whereRuleName> argument. |
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. 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". |
result |
Address of a SdaiLogical variable that will receive the result of the validation operation. The returned result is as follows: |
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;
SdaiAppInstance instance;
SdaiRuleSchema ruleSchemaId;
SdaiLogical result;
. . .
if (rstat = edmiValidateWhereRuleBN(
instance,
"Application_Context.Wr1",
"/usr/hkd/PDM/data/validation_print.text",
&result)) {
/* Error in operation */
printf("\nError: %s in edmiValidateWhereRuleBN\n",
edmiGetErrorText(rstat));
goto error;
}
switch (result) {
case sdaiTRUE:
. . . /* No violation in operation */
break;
case sdaiFALSE:
. . . /* Rule violation */
break;
default:
. . . /* Unpredictable result */
break;
}
. . .