edmiRemoteGetAttrsEx

EdmiError edmiRemoteGetAttrsEx(SdaiServerContext serverContextId,
                                 SdaiAppInstance   instance, 
                                 SdaiVersion       version, 
                                 SdaiInteger       nAttrs, 
                                 SdaiAttr          attributeIds[], 
                                 SdaiSelect        value[], 
                                 SdaiOptions       options, 
                                 SdaiInvocationId  *edmiInvocationId); 

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  The attributes are identified by their attributeIds. Optionally, this function may be used to determine if one or more attributes of an instance has been assigned values or are unset.

Arguments


TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

 SdaiAppInstance

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      

nAttrs

The number of attributes for which to to assign values.

SdaiAttr         

attributeIds

A buffer containing the attributeIds of all the attributes for which to read their values.

SdaiSelect       

value

A buffer of pre-allocated tSdaiSelect structures in which this function will return the attribute values.

SdaiOptions      

options

See description of available options below.  Options may be joined by using bitwise OR operator

SdaiInvocationId 

edmiInvocationId

Currently not used.

Return Value


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

 

Options


  

NameComment

GET_ATTRS

The function will return the attribute type and value in the <value> buffer.

TEST_ATTRS

The function will return a boolean value for each of the attributes in the <attributeIds> buffer. An sdaiTRUE value means the attribute has been assigned a value. An sdaiFALSE value indicate that the attribute is unset.

 

Example


 

 #define S_NATTR 3
 int i, j;
 EdmiError rstat;
 SdaiServerContext myContext;
 SdaiInteger index, nHits;
 SdaiAttr attrIds[S_NATTR];
 tSdaiSelect sel[S_NATTR];
 SdaiSelect attrVals[S_NATTR] = {&sel[0], &sel[1], &sel[2]};
 SdaiQueryResult qexRes;
  
 /* 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 = edmiRemoteGetAttrsEx(myContext,
 qexRes->instanceIds[i], 0, S_NATTR,  
 attrIds, &attrVals[0], GET_ATTRS, NULL); 
  
 printf("\n%s %s, Phone No. %s",  
 attrVals[0]->value.stringVal, 
 attrVals[1]->value.stringVal, 
 attrVals[2]->value.stringVal); 
  
 for (j=0;j<=S_NATTR;j++) { 
 edmiFree(attrVals[j]->value.stringVal); 
 } 
 }
 edmiFreeQueryResult(qexRes);
 . . .

 

See also

Filter by label

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

Â