Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Invokes the EDMexpressCompiler to compile a file containing one or more Schemata of a specified type. The following actions may be specified for the scamata 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 extention).
  4. Express Query Schemata (Express Schemata extention).

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!
Related functions: edmiRemoteDeleteSchema, edmiRemoteDeleteModel, edmiDefineSchema
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteDefineSchema(SdaiServerContext serverContextId,
                                  SdaiInteger       schemaType, 
                                  SdaiString        schemaFileName, 
                                  SdaiString        diagnosticFile, 
                                  SdaiString        schemasToStore, 
                                  SdaiUnsignedInt   options, 
                                  SdaiInteger       *nWarnings, 
                                  SdaiInteger       *nErrors,
                                  SdaiInvocationId  *edmiInvocationId);
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

schemaType

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

schemaFileName

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

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.

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.

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.

nWarnings

A variable that will receive the number of warnings found by the _EDMexpressCompiler{_}.

nErrors

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

edmiInvocationId

Currently not used.

Options: Descriptions:

EDM_EXPRESS_EXTENSION

The compiler will accept EDM extensions to Express, currently there is one, namely xpxPrintf (see _EDMassist_ Vol6).

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 and NO_RULE_STORED options.

NO_EXPRESSION_STORED

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

TC2

Parse the schema in accordance with Technical Corrigendum no.2

ERRORS_ONLY

Warnings will be suppressed.

EXPRESS_EDITION_2

Supports edition 2 of the Express language.

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.

EXTENSIVE_DIAGNOSTICS

Sets the highest available diagnostics report level.

DIAGNOSTICS_FOR_INTERFACED_ONLY

Diagnostics information will only be generated for interfaced schemata.

SDAI_WARNINGS

Activates _EDMinterface{_}/SDAI warnings relevant for the usage of _EDMinterface_ functions on an instantiated data model of the actual schema.

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.

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.

DIAGNOSTICS_FOR_ROOT_ONLY

Diagnostics information will not be generated for interfaced schemata.

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.

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.

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.

NO_DICTIONARY_MODEL

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

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!

MakeExpressXlongForm

Create an EXPRESSX lang form

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
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); 
. . .

  • No labels