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 Current »


 
Stores the current version of an edmModel using the built in revision control system of edm.
Any number of versions may be generated for an edmModel. All new verisons of an edmModel will be a appended to the list of modelVersionIds in the VERSIONS attribute of the model. A modelVersionId is an instance of the entity EDM_MODEL_VERSION in the ExpressDataManager model. This instance contains administrative information about the model version such as name, creation date and ownership.
Related functions: edmiRemoteCreateModel, edmiRemoteDeleteModel, edmiRemoteDeleteModelContents, edmiRemoteDeleteModelContentsBN, edmiRemoteDeleteModelVersion, edmiRemoteGetModel, edmiRemoteGetModelBN
 
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteCreateModelVersion(SdaiServerContext serverContextId,                                       SdaiString        repositoryName,                                       SdaiString        modelName,                                       SdaiString        modelVersionName,                                       SdaiModelVersion  *newModelVersionId,                                       SdaiInvocationId  *edmiInvocationId);
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

repositoryName

The name of the repository that contains the model of interest in the remote _EDMdatabase{_}. Repository names are case sensitive.

modelName

The name of the edmModel for which a new version shall be created.

modelVersionName

Optional name of the new model version. A model version name must start with a letter followed by any sequence of alphanumeric characters and underscore. Model names are case sensitive. All named versions of an edmModel must have unique names.

newModelVersionId

Variable that will receive the modelVersionId that uniquely identifies the model version in the remote EDMdatabase.

edmiInvocationId

Currently not used.

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;
SdaiModelVersion modelVersionId;
SdaiInstance instId;
SdaiServerContext myContext;
 
/* 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); 
 
/* Create Model */
rstat = edmiRemoteCreateModel(myContext,
"MyRepository", "MyModel", "MySchema",  
USE_DEFAULT_OPTIONS, NULL); 
 
/* Populate Model */
rstat = edmiRemoteCreateInstanceAndPutAttrsBN(myContext,
"MyRepository", "MyModel", "MyEntity", 1, &instId, NULL, 
"REAL_ATTR", sdaiREAL, 3.14); 
 
/* Create version 1 */
rstat = edmiRemoteCreateModelVersion(myContext,
"MyRepository", "MyModel", "V1", &modelVersionId, NULL); 
 
/* Change population */
rstat = edmiRemotePutAttrsBN(myContext, instId, 1, NULL,
"REAL_ATTR", sdaiINTEGER, 1); 
 
/* Create version 2. Named 'version2' by default. */
rstat = edmiRemoteCreateModelVersion(myContext,
"MyRepository", "MyModel", NULL, &modelVersionId, NULL); 
 
/* Roll back to version 1 */
rstat = edmiRollbackModelBN("MyRepository", "MyModel", "V1",
KEEP_ALL_MODEL_VERSIONS); 
 
/* Delete version 2 */
rstat = edmiRemoteDeleteModelVersion(myContext,
"MyRepository", "MyModel", "version2", NULL); 
. . .

  • No labels