edmiRemoteGetRuleSchema
EdmiError edmiRemoteGetRuleSchema(SdaiServerContext serverContextId, SdaiString schemaName, SdaiString ruleSchemaName, SdaiRuleSchema *ruleSchemaId, SdaiInvocationId *edmiInvocationId);
Returns the ruleSchemaid that uniquely identifies an EDMruleSchema in the remote EDMdatabase
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | schemaName | The name of the Express Schema for which the Query Schema has been compiled. This Express Schema must be compiled to form a dictionary model in the EDMdatabase . Express Schema names are case insensitive and unique within the scope of an EDMdatabase |
SdaiString | ruleSchemaName | The name of the Rule Schema for which to retrieve its unique ruleSchemaId. Rule Schema names are case insensitive and unique within the scope of an Express Schema. |
SdaiRuleSchema | ruleSchemaId | A variable that will receive the numeric ruleSchemaID that uniquely identifies the Rule Schema instance in the remote EDMdatabase |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Â
Options
 Â
Â
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; SdaiRuleSchema rexSchemaId; tSdaiSelect sel[2]; SdaiSelect param[1] = {&sel[0]}; SdaiSelect retVal = &sel[1]; SdaiLogical result; 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); /* Get the Rule Schema Id */ rstat = edmiRemoteGetRuleSchema(myContext, "Furniture", "Furniture_Rule", &rexSchemaId, NULL); printf("\nRule Schema Id = %d", rexSchemaId); /* Validate the globalRule */ /* At least 5 dining tables */ param[0]->nTypes = 0; param[0]->type = sdaiINTEGER; param[0]->typeList = NULL; param[0]->value.intVal = 5; rstat = edmiRemoteValidateGlobalRule(myContext, "DataRepository", "Products", "globalRule", 0, NULL, LOG_TO_FILE, "Furniture_Rule", &logDescr, 1, param, retVal, &result, NULL); /* Check the validation result */ switch(result) { case sdaiFALSE: printf("\nError: To few dining tables in the stock"); break; case sdaiUNKNOWN: printf("\nError: Undetermined status"); break; case sdaiTRUE: printf("\nThe stock is rule compliant"); break; } . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â