xpxConvertModels
FUNCTION xpxConvertModels (sourceModelsName : STRING; schemaMapName : STRING; targetModelsName : STRING; declarationsToLog : STRING; sourceLinesToLog : STRING; sourceInstancesToLog : STRING; logFile : STRING; maxLogFileSize : INTEGER; userOutputFile : STRING; options : INTEGER) status : INTEGER;
The xpxConvertModels function invokes the EDMmodelConverter to convert one or more existing data models (source models) in the EDMdatabase. The result of the conversion will normally be a new data model (target model) in the EDMdatabase. Optionally the result of this operation can be added to an existing data model. This operation can be used for model merging, i.e., merge more models to a new model or add the merge result to an existing model.
The invocation of a xpxConvertModels operation will not immediately activate the new "conversion/merging" process. The actual operation will be inserted in a queue and then immediately execution is resumed after the xpxConvertModels call in the calling process. The actual queue of "conversion/merging" processes will be handled when the current active EDMexpressVM process is terminated. The underlying schema of the target model (target schema) must exist as a dictionary model in the EDMdatabase before the EDMmodelConverter is invoked by this function. Likewise the Express-X schema that defines the conversion process must exist as an Express-X dictionary model before this function can be successfully executed. The functions edmiDefineSchema or xpxDefineSchema can be used to create a dictionary model of an Express schema in the EDMdatabase and the functions edmiDefineSchemaMap or xpxDefineSchemaMap can be used to create an Express-X dictionary model in the EDMdatabase. The source model will be unchanged when the conversion process is terminated. The EDMmodelConverter is utilizing the EDMexpressVM to perform the conversion process. To facilitate debugging of the conversion process, many options to trace the conversion process and to log events during the conversion process have been included. Express-X can be used as a programming language for creating, manipulating, and deleting data in any data model in the EDMdatabase that can be accessed by the caller, hence the specified Express-X schema can be successfully interpreted without creating in a new data model. An optional filter controls the logging of the conversion process. This filter is defined by the <declarationsToLog>, <sourceLinesToLog> and <options> arguments. The filter defines the following:
- What should be logged
- Which part of the Express-X schema should be logged
It is normally important to specify an appropriate logging filter to avoid the log output to fill up your disk.
Arguments
Type | Name | Comment |
STRING | sourceModelsName | The name of the source model |
STRING | schemaMapName | The name of the mapping schema |
STRING | targetModelsName | The name of the target model |
STRING | declarationsToLog | Can be used to define which EDMexpressX declarations in the actual EDMexpressX mapping schema that should be logged (traced) during execution. The declarations to log can be specified by their names or by the line numbers in the source EDMexpressX schema where they start. When more than one declaration is specified in the declarationsToLog argument, then the specifications should be separated by comma. When the declarationsToLog argument is an empty string, or is indeterminate (question), no EDMexpressX declarations will be logged. |
STRING | sourceLinesToLog | Can be used to specify one or more parts of the actual EDMexpressX mapping schema that should be logged (traced) at run time The actual parts to log are specified by line numbers in the source EDMexpressX schema. An interval is specified by the line number of the first line, followed by the character hyphen (minus), followed by the line number of the last line in the interval. When more than one part is specified, then each specification should be separated by a comma. When the sourceLinesToLog argument an empty string or as indeterminate (question),when no such logging should be performed. |
STRING | sourceInstancesToLog | Can be used to specify that the handling of one or more instances in the Source Model should be logged (traced) during the conversion process. The actual instances to log are specified by their instanceIds in the EXPRESS Data Manager database. An interval is specified by the instanceId of the first instance in the interval, followed by the character hyphen (minus) followed by the instanceId of the last instance in the interval. When more than one interval is specified, then each interval specification should be separated by a comma. The sourceInstancesToLog argument can be specified as an empty string or as indeterminate (question),when no such logging should be performed. |
STRING | logFile | Specifies the name of the log file to be used during the actual invocation of the EDMmodelConverter. An empty string or the value indeterminate for the logFile argument specifies that no log file will be used during the current EDMmodelConverter invocation. |
INTEGER | maxLogFileSize | Is used to specify the maximum size in bytes of the specified log file before the logging to the file is terminated or to rewrite over the previous logs again, dependent of the enabled options in the options argument. |
STRING | userOutputFile | is used to specify the name of a file used for all output from the xpxPrintf and xpxOutputValue functions. When this argument is empty or specified as indeterminate (question) then the output will be on the EDMmodelConverter main output device. |
INTEGER | options | specifies the EDMmodelConverter options that should be used during the current invocation. The options argument should be specified as a zero or as a sum of one or more integer constants. |
Return Value
Options
USER_OUTPUT_TO_FILE | Specifies that the result from the Express-X functions xpxPrintf and xpxOutputValue will be written to the file specified in the <userOutputFile> argument. When none of the options [USER_OUTPUT_TO_FILE] or [USER_OUTPUT_TO_STDOUT] are set, then the output from these function will be written to the actual <logFile> if defined, else the output from these functions will be written to the EDMinterface current output device. |
USER_OUTPUT_TO_STDOUT | Specifies that the result from the Express-X functions xpxPrintf and xpxOutputValue will be written to the EDMinterface current output device. When none of the options [USER_OUTPUT_TO_FILE] or [USER_OUTPUT_TO_STDOUT] are set, then the output from these function will be written to the actual <logFile> if defined, else the output from these functions will be written to the EDMinterface current output device. |
USE_EXISTING_TARGET_MODEL | The result of the conversion process will be added to the existing target model. |
DELETING_EXISTING_MODEL | Delete the target model before operation, if it already exists. |
FULL_LOG | Specifies that all logging options except [LOG_AGGREGATE_CONTENTS] should be activated during the conversion process. |
LOG_CONDITIONS | Specifies that the evaluation of all logical conditions in the actual Express-X schema should be logged. |
LOG_EXPRESSIONS | Specifies that the evaluation of all Express-X expressions should be logged. |
LOG_PREDEF_FUNCTIONS | Specifies that the execution of all built-in Express-X functions and procedures should be logged. |
LOG_FUNCTIONS | Specifies that the execution of all user defined functions and procedures should be logged. |
LOG_ITERATIONS | Specifies that all iterations should be logged. |
LOG_INSTANCE_CREATION | Specifies that all instance creation in the conversion process should be logged. |
LOG_ASSIGNMENTS | Specifies that the execution of all assignment statements should be logged. |
LOG_AGGREGATE_CONTENTS | Specifies that when the actual data type to be recorded is an aggregate, the value of all aggregate elements will be written in the log record, otherwise only the aggregateID would be written to the actual log record. Note: this option may generate very much log information. |
LOG_MAPPING_SCHEMA_ONLY | Log declarations in the mapping schema only, i.e. do not log evaluation of derived attributes in the source and target schemas. |
LOG_ERRORS | Specifies that all error events detected in the actual conversion process should be logged. |
LOG_WARNINGS | Specifies that all warning events detected in the actual conversion process should be logged. |
LOG_TO_FILE | Specifies that the log records should be written to the file specified in the <logFile> argument. The options LOG_TO_FILE and LOG_TO_STDOUT can be combined. |
LOG_TO_STDOUT | Specifies that the log records should be written to the EDMinterface current output device. The options LOG_TO_FILE and LOG_TO_STDOUT can be combined. |
Example
<Missing Example>
See also
Filter by label
There are no items with the selected labels at this time.