edmiRemoteDefineSchema

EdmiError edmiRemoteDefineSchema(SdaiServerContext serverContextId,
                                   SdaiInteger       schemaType, 
                                   SdaiString        schemaFileName, 
                                   SdaiString        diagnosticFile, 
                                   SdaiString        schemasToStore, 
                                   SdaiUnsignedInt   options, 
                                   SdaiInteger       *nWarnings, 
                                   SdaiInteger       *nErrors,
                                   SdaiInvocationId  *edmiInvocationId);


Invokes the EDMexpressCompiler  to compile a file containing one or more Schemata of a specified type. The following actions may be specified for the schema in the file.

  1. Syntax check.
  2. Schema consistency.
  3. Creation or modification of dictionary models.

The following schema types are supported by this function;

  1. Express Schemata (ISO10303-11).
  2. Express-X Schemata (ISO10303-14)
  3. Express Rule Schemata (Express Schemata extension).
  4. Express Query Schemata (Express Schemata extension).
  5. Extension Schemata

For Express schemata, the ISO 10303 Part 22 defines the standard for naming the dictionary models. The name of a dictionary model is equal to the name of the Express Schema, concatenated with "_DICTIONARY_DATA". A dictionary model name is in uppercase and case sensitive.
Dictionary models are by default write protected. Hence, they may not be opened by users for ordinary write access. Existing dictionary models may be removed from the database by the edmiRemoteDeleteSchema or the edmiRemoteDeleteModel functions. A precondition is that there exist no data models or associated Express-X dictionary models. Normally only Express schemata that are compiled without errors may be stored as dictionary models in the EDMdatabase. This default behaviour may be overruled by enabling the CONTINUE_STORING_ON_ERROR option.

Use the option CONTINUE_STORING_ON_ERROR with care! Populating erroneous dictionary models may cause unpredictable exceptions, including system crash!

 

Arguments


1TypeNameComment
2 SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

3 SdaiInteger

schemaType

The type of schemata to compile. Supported schema types are EXPRESS_SCHEMA_TYPE, RULE_SCHEMA_TYPE, QUERY_SCHEMA_TYPE, EXPRESS_X_SCHEMA_TYPE and EXTENSION_SCHEMA_TYPE.

4 SdaiString

schemaFileName

The name of the file on the local file system that contains the schemata to compile.

5 SdaiString

diagnosticFile

The name of the file that will receive the compilation diagnostic information. If this argument is NULL or an empty string, the diagnostic information will be written to the  EDMinterface  current output device.
Use edmiDefineOutputFunction to redefine the  EDMinterface  current output device.

6
SdaiString        

schemasToStore

A comma separated list of schema names to be compiled. If this parameter is NULL or an empty string, all schemata in the file <schemaFileName> will be compiled.

7
SdaiUnsignedInt   

options

See description of available options below. Options may be joined by using the bitwise OR operator. Default behaviour is that no subtypes be included in the returned entity extent.

8 SdaiInteger

nWarnings

A variable that will receive the number of warnings found by the  EDMexpressCompiler

9 SdaiInteger

nErrors

A variable that will receive the number of errors found by the EDMexpressCompiler

10
SdaiInvocationId  

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

EDM_EXPRESS_EXTENSION

The compiler will accept EDM extensions to Express, currently there is one, namely xpxPrintf

3

NO_EXPRESSION_CHECKED

Schema(ta) expressions will not be parsed and checked for syntactic correctness. This option implicitly sets the option NO_EXPRESSION_STORED as an unchecked expression cannot be stored in a dictionary model. Expressions may be found in the following Express constructs:

  • CONSTANT, DERIVE attributes
  • AGGREGATE bound specification
  • WHERE
  • FUNCTION
  • PROCEDURE
  • RULE

Setting this option also sets the

  • NO_EXPRESSION_STORED NO_DERIVE_CHECKED
  • NO_DERIVE_STORED NO_RULE_CHECKED
  • NO_RULE_STORED

options.

4

NO_EXPRESSION_STORED

None of the expressions described above will be stored in the resulting dictionary model(s).

5

TC2

Parse the schema in accordance with TC no.2

6

ERRORS_ONLY

Warnings will be suppressed.

7

EXPRESS_EDITION_2

Supports edition 2 of the Express language.

8

HTML_ERROR_LISTING

Compilation diagnostics will be written in HTML on files in the local file system directory defined by the system variable EDMS_TMP_DIR. The diagnostic report is ready to be displayed by an Internet browser. There are three or four HTML diagnostic files with the following names:
On UNIX: s_main.html, s_err.html, s_exp0.html and optionally s_sch.html
On Windows: s_main.htm, s_err.htm, s_exp0.htm and optionally s_sch.htm
The file named s_main.htm or s_main.html is the main file, hence this file should be specified within the actual Internet browser when displaying the diagnostic report.

9

EXTENSIVE_DIAGNOSTICS

Sets the highest available diagnostics report level.

10

DIAGNOSTICS_FOR_INTERFACED_ONLY

Diagnostics information will only be generated for interfaced schemata.

11

SDAI_WARNINGS

Activates  EDMinterface/SDAI warnings relevant for the usage of EDMinterface functions on an instantiated data model of the actual schema.

12

IGNORE_EMPTY_SELECT

No error message will be produced when the compiler detects that a SELECT definition, with an empty selection list, is interfaced from one schema to another.
Express constructions with expressions that refer to the empty select may not be properly checked when this option is set. This option should never be set when compiling schemata that will be used as the underlying schema for data models.

13

LOG_SCHEMA_INTERFACE

A log record will be written to the diagnostic report for each Express construct that is interfaced from one schema to another. This log record contains information such as the name of the interfaced construct, if it is explicit or implicit interfaced etc.

14

DIAGNOSTICS_FOR_ROOT_ONLY

Diagnostics information will not be generated for interfaced schemata.

15

STORING_SOURCE

The Express schema(ta) in its original form will be stored in the  EDMdatabase. This Express source can later be retrieved and displayed by the  EDMsupervisor  command Schemata>ShowSchemata.

16

DELETING_EXISTING_SCHEMAS

The existing dictionary model(s) with the same name as the resulting dictionary model(s) from this compilation will be replaced by the new dictionary model(s) as long as there are no data models associated with the existing dictionary model(s). Dictionary models may not be deleted before all the associated data models or associated Express-X dictionary models are deleted.

17

PARSE_ONLY

Specifies that the Express schema(ta) will be checked for syntax errors only. No dictionary models will be created when this option is enabled.

18

NO_DICTIONARY_MODEL

Specifies that no dictionary models will be created by the current invocation of the edmiRemoteDefineSchema operation.

19

CONTINUE_STORING_ON_ERROR

Enforces the EDMexpressCompiler  to create and populate a dictionary model of erroneous schema(ta). Only schema(ta) compiled without any errors can be stored as a dictionary model(s) in the EDMdatabase  when this option is unset.
NOTE: Use this option with care! It may cause unpredictable results. Possibly even fatal system failure!

20

MakeExpressXlongForm

Create an EXPRESSX lang form

Example


 

 EdmiError rstat;
 SdaiInteger nWrn, nErr;
 SdaiServerContext myContext;
 SdaiSchema schemaId;
  
 /* Define Remote Server Context */
 rstat = edmiDefineServerContext("MyRemoteServerContext",
 "Johnny", "Supervisor", "cf37ftr", 
 "TCP", "9090", "MyServerHost", 
 NULL, NULL, NULL, NULL, NULL, &myContext); 
  
 /* Compile schema */
 rstat = edmiRemoteDefineSchema(myContext, EXPRESS_SCHEMA_TYPE,
 "c:/data/MyFile.exp", "c:/tmp/MyFile.dia", "MySchema", 
 DELETING_EXISTING_SCHEMAS | STORING_SOURCE, 
 &nWrn, &nErr, NULL); 
  
 /* Get the id of schema MySchema */
 rstat = edmiRemoteGetSchema(myContext, "MySchema",
 &schemaId, NULL); 
  
 /* Get the HTML source
 of schema MySchema */ 
 rstat = edmiRemoteGetSchemaSource(myContext, EXPRESS_SCHEMA_TYPE,
 "MySchema", NULL, SHOW_HTML,  
 "c:/out/MySchema.html", NULL); 
 . . .

 

See also

Filter by label

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