edmiValidateWhereRuleWithParametersBN


 


 

EdmiError edmiValidateWhereRuleWithParametersBN (SdaiAppInstance   instance, 
                                                  SdaiString        whereRuleName, 
                                                  SdaiRuleSchema    ruleSchemaId, 
                                                  SdaiString        userOutputFile, 
                                                  SdaiLogical       *result, 
                                                  SdaiPrimitiveType *returnValueDatatype, 
                                                  void              *returnValue, 
                                                  SdaiInteger       numberOfParameters, 
                                                  /* For each user parameter: 
                                                    [SdaiPrimitiveType parameterDataType, 
                                                    parameterValue] */ 
                                                   . . . ); 

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 appropriate to the specified instance. This operation is the same as the edmiValidateWhereRule 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 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.

Arguments


TypeNameComment
SdaiAppInstance

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.
The specified instance must be located in an open data model.

SdaiStringwhereRuleNameThe 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.
SdaiRuleSchema

ruleSchemaId

 A numeric ruleSchemaID that uniquely identifies the rule schema instance in the EDMdatabase that defines the local rule specified in the <whereRuleName> argument.
The specified where rule must be defined in the dictionary model (Express schema) that is the underlying schema of the data model that hosts the specified instance <instance> if the <ruleSchemaId> is set to zero.
The ruleSchemaID can be retrieved by the edmiGetRuleSchema operation.

SdaiString

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".
The output from the xpxPrintf and xpxOutputValue function during the validation process 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 local rule violation
  • sdaiFALSE: Actual instanceID violates specified local rule.
  • sdaiUNKNOWN: Unpredictable result due to unset values or error in operation. Use sdaiErrorQuery to check for 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 datatype 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;
 SdaiAppInstance instance;
 SdaiLogical result;
 SdaiString *returnedText;
 . . .
 if (rstat = edmiValidateWhereRuleWithParametersBN(
 instance, 
 "myEntity.whereRule1", 
 "/usr/hkd/AP214/data/validation_print.text", 
 &result, 
 sdaiSTRING, 
 (void *) &returnedText, 
 1, 
 sdaiINTEGER, 88459)) { 
 /* Error in operation */ 
 printf("\nError: %s in edmiValidateWhereRuleWithParametersBN\n", 
 edmiGetErrorText(rstat)); 
 goto error; 
 }
 switch (result) {
 case sdaiTRUE: 
 . . . /* No violation in operation */ 
 break; 
 case sdaiFALSE: /* Rule violation */ 
 printf("\nReturned text: %s", returnedText);  
 . .  
 break; 
 default: 
 . . . /* Unpredictable result */ 
 break; 
 }
 . . .

 

See also

Filter by label

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