Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
EdmiError edmiRemoteGetInstanceModel(SdaiServerContext serverContextId,
                                       SdaiInstance      currInst,
                                       SdaiRepository    *repositoryId,
                                       SdaiModel         *modelId,
                                       SdaiInvocationId  *edmiInvocationId);


Returns the repositoryId and the modelId of the edmRepository and edmModel that contain a given instance specified by its instanceId.

...

Arguments

...

TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiInstance

currInst

The numeric instanceID that uniquely identifies the application instance for which to retrieve the modelId and repositoryId in the remote _EDMdatabase{_}.remote  EDMdatabase

SdaiRepository

repositoryId

A variable that will receive the numeric repositoryId that uniquely identifies the edmRepository in a remote _ EDMdatabase_ .

SdaiModel

modelId

A variable that will receive the numeric modeld that uniquely identifies the edmRepository in a remote _EDMdatabase_ .remote  EDMdatabase

SdaiInvocationId

edmiInvocationId

Currently not used.

...

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

 

Options

...

  

 

Example

...

 

Code Block
languagecpp
 EdmiError rstat;
 SdaiServerContext myContext;
 SdaiRepository repositoryId;
 SdaiModel modelId;
 SdaiEntity entityId;
 SdaiString entityName;
 SdaiInstance instId;
 SdaiAttr attrId;
 SdaiPrimitiveType attrType;
 SdaiString stringId = "721212";
 SdaiInteger integerId = 721212;
 SdaiVoid value;
  
 /* In this example, the instance Id, instId
 is an input parameter. The type of instance 
 is not specified, but it is assumed to have 
 an ID attribute of either string or integer 
 type. */ 
  
 /* Create Server Context */
 rstat = edmiDefineServerContext("MyContext",
 "Johnny", "Supervisor", "cf37ftr", 
 "TCP", "9090", "MyServerHost", 
 NULL, NULL, NULL, NULL, NULL, &myContext); 
  
 /* Find the repositoryId and
 the modelId of the instance */ 
 rstat = edmiRemoteGetInstanceModel(myContext,
 instId, &repositoryId, &modelId, NULL); 
  
 /* Get instance type */
 rstat = edmiRemoteGetInstanceType(myContext,
 instId, &entityId, &entityName, NULL); 
  
 /* Get the Id of the ID attribute */
 rstat = edmiRemoteGetAttrDefinition(myContext, entityId,
 "ID", &attrId, NULL); 
 if (rstat == sdaiEATTRUNDEF) {
 printf("\nEntity %s does not have an ID attribute", entityName); 
 goto err; 
 }
  
 /* Find the primitive type of the attribute */
 rstat = edmiRemoteGetAttrPrimitiveType(myContext,
 attrId, &attrType, NULL); 
  
 /* Apply the proper ID format */
 switch(attrType) {
  
 case sdaiINTEGER: value = &integerId; 
 break; 
 case sdaiSTRING: value = &stringId; 
 break; 
 default: printf("\nInvalid ID attribute type"); 
 goto err; 
 }
  
 /* Insert the Id */
 rstat = edmiRemotePutAttrsBN(myContext, instId, 1, NULL,
 "ID", attrType, value); 
 . . .

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"