Deletes a version of an edmModel identified by the model version name.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteDeleteModelVersion(SdaiServerContext serverContextId,
SdaiString repositoryName,
SdaiString modelName,
SdaiString modelVersionName,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
repositoryName |
The name of the edmRepository that contains the edmModel for which a version is to be deleted in the remote _EDMdatabase{_}. Repository names are case sensitive. |
modelName |
The name of the edmModel for which a version is to be deleted. Model names are case sensitive. |
modelVersionName |
The name of the model version to delete. This is the name that was assigned to the model version when it was created. |
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);
. . .