edmiRemoteGetAttrs

EdmiError edmiRemoteGetAttrs(SdaiServerContext serverContextId,
                               SdaiInstance      instance, 
                               SdaiVersion       version, 
                               SdaiInteger       numberAttr, 
                               SdaiInvocationId  *edmiInvocationId, 
                              /* [SdaiAttr attributeId, SdaiPrimitiveType valueType, void *value] */ 
                                ...); 


Returns the value of the one or more specified attributes of an application instance. The instance is specified by its numeric instanceID that uniquely identifies it in the remote EDMdatabase, these attributes are identified by their attributeIds. For each attribute value to read the following three arguments must be specified: <attributeID>, <valueType>, <value>

Arguments


TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiInstance     

instance

A numeric instanceID that uniquely identifies the instance of interest in the remote  EDMdatabase

SdaiVersion      

version

The version of the edmModel to apply this function call on. The <version> parameter is a numeric sequence number counting from one by increments of one for each new model version that is created. A zero model version number means the current version.

SdaiInteger      

numberAttr

The number of attributes for which to to assign values.

SdaiInvocationId

edmiInvocationId

Currently not used.

SdaiAttr

attributeID

The numeric attributeId that uniquely identifies the attribute definition instance in the remote EDMdatabase.

SdaiPrimitiveTypevalueTypeThe primitive type of the attribute. This type must be the same as the actual data type of the attribute value or any compatible data type. The primitive type sdaiSELECT can be used to get all data types. The primitive type sdaiADB can be used to get all data types except typed values. The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed automatically when required. <value> : The
voidvaluevariable that will hold receive the data value from the actual attribute.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

 

Options


  

 

Example


 

 #define S_NATTR 3
 int i, j;
 EdmiError rstat;
 SdaiServerContext myContext;
 SdaiInteger index, nHits;
 SdaiAttr attrIds[S_NATTR];
 SdaiQueryResult qexRes;
 SdaiString attrVals[S_NATTR];
  
 /* Create Server Context */
 rstat = edmiDefineServerContext("MyContext",
 "Johnny", "Supervisor", "cf37ftr", 
 "TCP", "9090", "MyServerHost", 
 NULL, NULL, NULL, NULL, NULL, &myContext); 
  
 /* Get attribute ids of the Person entity */
 rstat = edmiRemoteGetAttrDefinitionBN(myContext, "MySocialRelations",
 "Person", "FIRST_NAME", &attrIds[0], NULL); 
 rstat = edmiRemoteGetAttrDefinitionBN(myContext, "MySocialRelations",
 "Person", "LAST_NAME", &attrIds[1], NULL); 
 rstat = edmiRemoteGetAttrDefinitionBN(myContext, "MySocialRelations",
 "Person", "PHONE_NO", &attrIds[2], NULL); 
  
 /* Select all person instances */
 rstat = edmiRemoteSelectInstances(myContext, "MyRepository",
 "MySocialRelations", "Person", 
 NULL, ONLY_INSTANCE_IDS, NULL, NULL, NULL, 
 &index, &nHits, &qexRes, NULL, NULL, NULL, NULL); 
  
 /* Get their names and phone numbers */
 for (i=0;i<nHits;i++) {
 rstat = edmiRemoteGetAttrs(myContext,
 qexRes->instanceIds[i], 0, S_NATTR, NULL,  
 attrIds[0], sdaiSTRING, &attrVals[0], 
 attrIds[1], sdaiSTRING, &attrVals[1], 
 attrIds[2], sdaiSTRING, &attrVals[2]); 
  
 printf("\n%s %s, Phone No. %s",  
 attrVals[0], attrVals[1], attrVals[2]); 
  
 for (j=0;j<=S_NATTR;j++) { 
 edmiFree(attrVals[j]); 
 } 
 }
 edmiFreeQueryResult(qexRes);
 . . . 

 

See also

Filter by label

There are no items with the selected labels at this time.