Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 
SYNTAX:
 
xpxValidateInstance (instanceId        : GENERIC;
                     diagnosticFile    : STRING;
                     options           : INTEGER;
                      VAR resultModelId : GENERIC)
                      status            : INTEGER;
 
The xpxValidateInstance function validates an instance, i.e. checks that the attribute values of the instance do not violate any of the constraints/rules defined in the corresponding entity definition.
<instanceId>  The instance to be checked.
<diagnosticFile> Name of file where the diagnostics are placed.
The argument options specifies the options that should be used during the validation. The options argument should be specified as a zero or as a sum of one or more of the following integer constants:
    

  •  XPXAGGREGATE_DATA_TYPE
  • XPXAGGREGATE_UNIQUENESS
  • XPXATTRIBUTE_DATA_TYPE
  • XPXDETAILED_OUTPUT
  • XPXFULL_VALIDATION
  • XPXAGGREGATE_SIZE
  • XPXARRAY_REQUIRED_ELEMENTS
  • XPXCREATE_RESULT_MODEL
  • XPXFULL_OUTPUT
  • XPXSTOP_ON_FIRST_ERROR

...

Code Block
languagecpp
themeConfluence
FUNCTION xpxValidateInstance (instanceId        : GENERIC;
                              diagnosticFile    : STRING;
                              options           : INTEGER;
                              VAR resultModelId : GENERIC)
                              status            : INTEGER;

This function invokes the EDMmodelChecker to validate a particular instance. The result of the validation can either be a text report or a population of the EXPRESS schema EDM_Validation_Result_Schema. The latter case enables the caller to make his own diagnostic report in his own format. There exist two options that will influence the amount of information in the validation report produced by this function: NO_PRINT_OUTPUT and FULL_OUTPUT. A standard validation report will be produced when none of these options are set in the <options> argument. A validation report with all available detailed information is produced when the FULL_OUTPUT option is set. No validation report will be produced when the NO_PRINT_OUTPUT option is enabled. The validation result would then normally be in a population of the EDM_Validation_Result_Schema. When validating an instance against rules specified in an EDMruleSchema, only he following validation options are effective: XPXFULL_VALIDATION, XPXGLOBAL_RULES, XPXLOCAL_RULES, and XPXUNIQUENESS_RULES. XPXFULL_VALIDATION means in this context: XPXGLOBAL_RULES | XPXLOCAL_RULES | XPXUNIQUENESS_RULES . This function is only applicable to application instances. The data model that holds the instance to validate must be open before this operation can be successfully performed. The expressions logging can be used to log (trace) the execution of the validation process in the EDMexpressVM. The EDMsupervisor and the interactive EDMdebugger can be used for testing and debugging the rules as well as getting detailed information of a validation process.

Arguments

...

TypeNameComment
GENERICinstanceIdSpecifies a numeric instanceID that uniquely identifies an application instance in the EDMdatabase to be validated.
STRINGdiagnosticFileSpecifies the file name for diagnostic information generated by this function. If no file name is supplied, i.e. the <diagnosticFile> argument is set to NULL, all diagnostic information will be written to the EDMinterface current output device. The EDMinterface current output device can be defined by the edmiDefineOutputFunction operation. No diagnostics report will be produced by this function when the NO_PRINT_OUTPUT option is set.
INTEGERoptionsSpecifies the enabled options used by the EDMmodelChecker in the current invocation. The <options> value is specified as a bitwise OR between the enabled options.
GENERICresultModelIdThe address of a variable of type SdaiInstance that will receive a numeric instanceID that uniquely identifies an instance of type validation_error in a population of the EDM_Validation_Result_Schema that contains all details of the violations detected in the last invocation of the EDMmodelChecker. No population of the EDM_Validation_Result_Schema will be produced when the <resultModelId> argument is NULL on input.

Return Value

...

Insert excerpt
US:_r_XPX_Return_Value
US:_r_XPX_Return_Value
nopaneltrue

Options

...


OptionComment
1

XPXFULL_VALIDATION

Specifies that the actual instance will be validated against all rules and constrains that is applicable for this particular instance.

2

XPXGLOBAL_RULES

Specifies that all global rules appropriate for the specified instance will be validated. These global rules are defined in the appropriate dictionary model (Express schema) or defined in the specified EDMruleSchema.

3

XPXLOCAL_RULES

Specifies that all local rules (Where rules) appropriate for the specified instance will be validated. These local rules are defined in the appropriate dictionary model (Express schema) or defined in the specified EDMruleSchema.

4

XPXINVERSE_RULES

Specifies that all Inverse constraints defined for the actual instance will be validated.

5

XPXUNIQUENESS_RULES

Specifies that all Uniqueness rules defined for the actual instance will be validated.

6

XPXREQUIRED_ATTRIBUTES

Specifies that all mandatory attributes, i.e., all explicit attributes that are not declared to be OPTIONAL, of the instance will be checked for an assigned value, i.e., checked that the attribute values are set.

7

XPXATTRIBUTE_DATA_TYPE

Specifies that all attribute values of the instance will be checked for legal data type.

8

XPXAGGREGATE_DATA_TYPE

Specifies that all element values in all aggregates owned by the specified instance will be checked for legal data type.

9

XPXAGGREGATE_SIZE

Specifies that the number of elements in all aggregates owned by the specified instance is according to the related aggregate declarations.

10

XPXARRAY_REQUIRED_ELEMENTS

Specifies that all elements in arrays, that are not declared as OPTIONAL, owned by the instance, will be checked for an assigned value, i.e., checked that no unset elements exists.

11

XPXAGGREGATE_UNIQUENESS

Specifies that all aggregates owned by the specified instance will be validated for uniqueness violation. Aggregates that have an uniqueness constraints are all SET aggregates, and ARRAY and LIST aggregates that are declared with the optional keyword UNIQUE.

12

XPXUNSET_DERIVE_ATTRIBUTES

Specifies that warnings will be issued if unset derived attributes are found.

13

XPXOUTPUT_STEPID

Specifies that the stepID corresponding to the instanceID will be written to the validation report when the actual correspondence exists in a STEP Identifier model.

14

XPXFULL_OUTPUT

Specifies that all available information about the source of the errors will be recorded in the diagnostic report from this command.

15

XPXSTOP_ON_FIRST_ERROR

Specifies that the validation process should terminate when the first error is detected.

 

Example

...

Code Block
languagecpp
<Missing Example>

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "extension_schema" and parent = "5636522"