edmiValidateGlobalRuleWithParameters


 

EdmiError edmiValidateGlobalRuleWithParameters(SdaiModel         modelId, 
                                                SdaiGlobalRule    globalRuleId, 
                                                SdaiString        userOutputFile, 
                                                SdaiLogical       *result, 
                                                SdaiPrimitiveType *returnValueDatatype, 
                                                void              *returnValue, 
                                                SdaiInteger       numberOfParameters, 
                                                 /* For each user parameter: 
                                                 [SdaiPrimitiveType parameterDataType, parameterValue] */ 
                                                ... ); 

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. This operation is the same as the edmiValidateGlobalRule except that the actual application can supply arguments to the validation process, hence making the validation process parameterized. The validation process can return additional information to the application through the < returnValue> argument. 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.

Arguments


TypeNameComment
SdaiModel

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

SdaiGlobalRule

globalRuleId

A numeric globalRuleID that uniquely identifies the global rule to validate. The globalRuleID can be found by invoking the edmiGetGlobalRule operation.

SdaiString

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.

SdaiLogical

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.
SdaiPrimitiveType

returnValueDataType

Address of a variable of type SdaiPrimitiveType that is used both as an input argument and an output argument:

  • Input: specifies the expected datatype of the value returned in the <returnValue> argument. The returned value must be type compatible with the datatype specified in the <returnValueDataType> argument.
  • Output: actual data type of the return value <returnValue>. When no value is returned the <returnValueDatatype> is set to sdaiINDETERMINATE.
void

returnValue

Address of variable that will receive the value from the actual validation process. The actual value must be specified by invoking the xpxReturnValueToCaller procedure in the validation process in the EDMexpressVM.

SdaiInteger

numberOfParameters

Specifies the number of parameters supplied in the actual invocation of the operation. For each parameter the following two arguments must be specified in this order:

SdaiPrimitiveType

parameterDataType

The data type of the actual parameter value specified as a SdaiPrimitiveType value.

 

parameterValue

Actual parameter value.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

Options


 

Example


 

EdmiError rstat;
 SdaiModel modelId;
 SdaiGlobalRule globalRuleId;
 SdaiLogical result;
 SdaiAppInstance returnedInstance;
 . . .
 if (rstat = edmiValidateGlobalRuleWithParameters(
 modelId, 
 globalRuleId, 
 "/usr/hkd/ifc/data/validation_print.text", 
 &result, 
 sdaiINSTANCE, 
 (void *) &returnedInstance, 
 2, 
 sdaiINTEGER, 512, 
 sdaiSTRING, "PRODUCT_A012XYZ")) { 
 /* Error in operation */ 
 printf("\nError: %s in edmiValidateGlobalRuleWithParameters\n", 
 edmiGetErrorText(rstat)); 
 goto error; 
 }
 switch (result) {
 case sdaiTRUE: 
 . . . /* No violation in operation */ 
 break; 
 case sdaiFALSE: /* Rule violation */ 
 printf("\nFailing instance: %lu", returnedInstance); 
 . . .  
 break; 
 default: 
 . . . /* Unpredictable result */ 
 break; 
 }
 . . .

 

See also

Filter by label

There are no items with the selected labels at this time.


Arguments: