edmiRemoteGetAttrsBNEx
EdmiError edmiRemoteGetAttrsBNEx(SdaiServerContext serverContextId, SdaiAppInstance instance, SdaiVersion version, SdaiInteger nAttrs, SdaiString attributeName[], 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 names. Optionally, this function may be used to determine if one or more attributes of an instance has been assigned values or are unset.
Arguments
Type | Name | Comment |
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. |
SdaiString | attributeName | A buffer of string pointers. Each string pointer represents an attribute name for which to read its value. |
SdaiSelect | value | A buffer of pre-allocated tSdaiSelect structures. Each select structure will receive one attribute value. |
SdaiOptions | options | See description of available options below. Options may be joined by using bitwise OR operator |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Â
Options
 Â
Option | Comment |
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 <attributeName> buffer. An sdaiTRUE value means the attribute has been assigned a value. An sdaiFALSE value indicate that the attribute is unset. |
Â
Example
Â
 #define S_BUFFSIZE 10 int i; EdmiError rstat; SdaiServerContext myContext; SdaiInstance buff[10]; SdaiInteger index, nHits, nTot; /* Create Server Context */ rstat = edmiDefineServerContext("MyContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Find carpenters among my friends */ nTot = nTot = 0; nHits = S_BUFFSIZE; while (nHits == S_BUFFSIZE) { rstat = edmiRemoteFindInstancesBNEx(myContext, "MyRepository", "MySocialRelations", "MyFriends", "PROFESSION = 'Carpenter'", S_BUFFSIZE * sizeof(SdaiInstance), &index, &nHits, &buff[0], NULL); /* Get names and phone numbers */ for (i=0;i<nHits;i++) { SdaiString _attrName[3] = {"FIRST_NAME", "LAST_NAME", "PHONE_NO"}; tSdaiSelect _sel[3]; SdaiSelect _attrVal[3] = {&_sel[0], &_sel[1], &_sel[2]}; rstat = edmiRemoteGetAttrsBNEx(myContext, buff[i], 0, 3, _attrName, _attrVal, GET_ATTRS, NULL); printf("\n%s %s, Phone No. %s", _sel[0].value.stringVal, _sel[1].value.stringVal, _sel[2].value.stringVal); } nTot += nHits; ++index; } printf ("\n%d carpenters found among my friends!"); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â