edmiRemoteValidateInstanceType

EdmiError edmiRemoteValidateInstanceType (SdaiServerContext  serverContextId, 
                                           SdaiString         remoteRepositoryName, 
                                           SdaiString         remoteMmodelName, 
                                           SdaiString         entityName, 
                                           SdaiString         diagnosticFile, 
                                           SdaiInteger        nFileMappings, 
                                           SdaiFileMapping    fileMapping[], 
                                           SdaiInteger        options,
                                           SdaiString         remoteRuleSchemaName, 
                                           SdaiLogDescription logDescription,
                                           SdaiInteger        numberOfParameters,
                                           SdaiSelect         parameters[],
                                           SdaiSelect         userReturnedValue,
                                           SdaiInteger        *warnings,
                                           SdaiInteger        *errors,
                                           SdaiInvocationId   *edmiInvocationId);


Invokes the EDMmodelChecker to validate all application instances of a given type against a specified set of rules in a remote EDMdatabase. The rules must be defined within the dictionary model of the data model. They may be defined in the data models underlying Express Schema or in any EDMruleSchema that has been compiled to extend the data models dictionary model. Optionally, instances of any subtype of the given instance type may be included in the validation. The result of the validation may be a plain text report or a population of the EDM_VALIDATION_RESULT_SCHEMA. The validation result population may be used for generating validation reports with a user defined layout and format. The expressions logging can be used to trace the validation process in the EDMexpressVM. The EDMsupervisor and the interactive EDMdebugger may be used for testing and debugging rules as well as for getting detailed information from the validation process.

Arguments


1TypeNameComment
2SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

3SdaiString

remoteRepositoryName

The name of the repository in the remote _EDMdatabase_ that contains the population to be validated. Repository names are case sensitive.

4SdaiString

remoteMmodelName

The name of the model that contains the instances to be validated. Model names are case sensitive. The combination of the <remoteRepositoryName> and <remoteModelName> arguments uniquely identifies a model in a remote  EDMdatabase

5SdaiString

entityName

The name of the entity that defines the instance type to validate. Entity names are case insensitive.

6SdaiString

diagnosticFile

The name of the file that will receive any diagnostic information generated by this function. A NULL or empty string value will send the diagnostic information to the  EDMinterface current output device.

7SdaiInteger

nFileMappings

Currently not used.

8SdaiFileMapping

FileMapping

Currently not used.

9SdaiInteger

options

See description of available options below.  Options may be joined by using the bitwise OR operator

10SdaiString

remoteRuleSchemaName

The name of the EDMruleSchema to use for the validation. Rule schema names are case insensitive. If this argument is NULL or an empty string, the instance will be validated against the rules and constraints defined in the models underlying Express Schema.

11SdaiLogDescription

logDescription

An SdaiLogDescription structure containing the specifications for the logging of the validation process.

12SdaiInteger

numberOfParameters

The number of parameters in the <parameters> argument.

13SdaiSelect

parameters

Buffer of pointers to locally allocated tSdaiSelect structures. Each tSdaiSelect structure defines the type and value of an input parameter to the validation process.

14SdaiSelect

userReturnedValue

Pointer to a locally allocated tSdaiSelect structure that may be used by the global rule to communicate a user defined status with the calling application.

15SdaiInteger

warnings

A variable that will receive the number of warnings encountered in the validation process.

16SdaiInteger

errors

A variable that will receive the number of errors encountered in the validation process.

17SdaiInvocationId

edmiInvocationId

Currently not used.

Return Value


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

 

Options


  

1OptionComment
2

UNSET_DERIVE_ATTRIBUTES

The validation will check for unset derived attributes.  This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

3

OUTPUT_STEPID

The diagnostic information will refer to stepIds rather than to the instanceIds used for identification of instances within the remote  EDMdatabase . This option is only applicable for models that have been imported from step files with the KEEP_STEP_IDENTIFIERS option.

4

SUBTYPES

Instances of any subtype of the specified instance type will be validated.

5

INVERSE_RULES

The validation will check for unset Inverse Constraints. This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

6

GLOBAL_RULES

The validation will include any applicable global rule.

7

REQUIRED_ATTRIBUTES

The validation will check for unset non-optional explicit attributes. This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

8

ATTRIBUTE_DATA_TYPE

The validation will check for explicit attribute values with data types that do not comply with their declaration. This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

9

UNIQUENESS_RULES

The validation will include any applicable Uniqueness Rule.

10

LOCAL_RULES

The validation will include any applicable Where Rule.

11

AGGREGATE_SIZE

The validation will check for aggregates with numbers of elements that fail to comply with their declaration. This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

12

ARRAY_REQUIRED_ELEMENTS

The validation will check for arrays with unset non-optional elements.  This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

13

AGGREGATE_UNIQUENESS

The validation will check for any aggregate that fail to comply with its uniqueness declaration. The SET type aggregate has a built-in uniqueness rule that will cause a warning if two or more equal values are found among its elements.
This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

14

FULL_VALIDATION

The validation will include all applicable rules and constraints.  when the <ruleSchemaId> argument is zero, 

15

AGGREGATE_DATA_TYPE

The validation will check for aggregate elements with data types that do not comply with their declaration. This option is applicable only when the <remoteRuleSchemaName> argument is NULL or an empty string.

16

DETAILED_OUTPUT

 

17

FULL_OUTPUT

Any available information about the cause of an error will be recorded in the diagnostic report.

18

STOP_ON_FIRST_ERROR

The validation process will terminate after encountering the first error.

 

Example


 

 /*
 - -------------------------------------- 
 - File: c:/data/furniture.exp 
 - -------------------------------------- 
 SCHEMA Furniture; 
 TYPE tScrewType = ENUMERATION OF (PHILIPS, ALLEN, FLAT); END_TYPE; 
 ENTITY Screw; 
 Id : STRING; 
 Typ : tScrewType; 
 Len : REAL; 
 Dia : REAL; 
 END_ENTITY; 
 ENTITY Dining_Table; 
 Name : STRING; 
 Legs : INTEGER; 
 Len : REAL; 
 Width : REAL; 
 Height : REAL; 
 Screws : BAG OF Screw; 
 END_ENTITY; 
 END_SCHEMA; 
  
 - -------------------------------------- 
 - File: c:/data/furniture_rule.rex. 
 - -------------------------------------- 
 RULE_SCHEMA Furniture_Rule FOR Furniture; 
  
 - GLOBAL RULE: 
 - At least N tables in stock, where N 
 - is an input parameter to the rule. 
 RULE globalRule FOR (Dining_Table); 
 LOCAL 
 nTables : INTEGER; 
 END_LOCAL; 
 xpxGetUserParameter(1, nTables); 
 WHERE 
 w_nTables : SIZEOF(Dining_Table) > nTables; 
 END_RULE; 
  
 - LOCAL RULE: 
 - A dining table must have 4 legs 
 ENTITY Dining_Table; 
 WHERE 
 w_nLegs : Legs = 4; 
 END_ENTITY; 
  
 END_RULE_SCHEMA; 
 */
 EdmiError rstat, error;
 SdaiInteger nErr, nWrn;
 SdaiServerContext myContext;
 tSdaiSelect sel, *retVal = &sel;
 tSdaiLogDescription logDescr = {
 FULL_LOG | LOG_TO_FILE,  
 NULL, NULL, 
 "c:/temp/globalRule.dia", 
 "c:/temp/globalRule.out", 
 104857600 }; 
  
 /* Define Remote Server Context */
 rstat = edmiDefineServerContext("MyRemoteServerContext",
 "Johnny", "Supervisor", "cf37ftr", 
 "TCP", "9090", "MyServerHost", 
 NULL, NULL, NULL, NULL, NULL, &myContext); 
  
 /* Compile the Express Schema */
 rstat = edmiRemoteDefineSchema(myContext, EXPRESS_SCHEMA_TYPE,
 "c:/data/furniture.exp", "c:/temp/furniture.dia",  
 "Furniture", 0, &nWrn, &nErr, NULL); 
  
 /* Compile the Rule Schema */
 rstat = edmiRemoteDefineSchema(myContext, RULE_SCHEMA_TYPE,
 "c:/data/furniture_rule.rex", "c:/temp/furniture_rule.dia", 
 "Furniture_Rule", 0, &nWrn, &nErr, NULL); 
  
 /* Import the product catalogue from a p21 file
 into the model Products in the DataRepository */ 
 rstat = edmiRemoteReadStepFile(myContext, "DataRepository",
 "Products", NULL, NULL, "c:/data/furniture.stp", 
 "c:/temp/furniture.stp.dia", "Furniture", NULL, 
 0, &nWrn, &nErr, &error, NULL); 
  
 /* Validate all dining tables */
 rstat = edmiRemoteValidateInstanceType(myContext, "DataRepository",
 "Products", "Dining_Table", "c:/temp/validation_result.out",  
 0, NULL, FULL_VALIDATION | FULL_OUTPUT, "Furniture_Rule", 
 &logDescr, 0, NULL, retVal, &nWrn, &nErr, NULL); 
 . . . 

 

See also

Filter by label

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

Â