Determines whether one ore more attributes, identified by their names, of a specified instance, identified by its instanceId, are unset or have been assigned values. The attribute names are specified in the input buffer argument <attributeNames>. A buffer with the same number of booleans will be returned in the argument <valueSet>. Any unset attributes will have their corresponding elements in the <valueSet> buffer set to sdaiFALSE. Likewise, if an attribute is set, i.e has been assigned a value, the corresponding <valueSet> buffer element will be set to sdaiTRUE.
Related function: edmiRemoteTestAttrs
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteTestAttrsBN(SdaiServerContext serverContextId,
SdaiInstance instanceId,
SdaiVersion version,
SdaiInteger attributes,
SdaiString attributeNames[],
SdaiBoolean **valueSet,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
instanceId |
A numeric instanceID that uniquely identifies the instance of interrest in the remote _EDMdatabase{_}. |
version |
The version of the edmModel to apply this fuction call on. The version argument is a sequence number counting from one by increments of one for each new model version created. A zero version number means the current version of the edmModel. |
attributes |
The number of attribute names in the <attributeNames> argument. |
attributeNames[] |
A buffer containing all the attribute names to be checked. |
valueSet |
A variable that will receive a pointer to a buffer of SdaiBoolean elements. Each element describes the set/unset status of the corresponding attribute specified in the <attributeNames> argument. |
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;
SdaiServerContext myContext;
SdaiQueryResult qexRes;
SdaiInstance *pInst;
SdaiInteger index = 0, nHits = 10000;
SdaiBoolean isRevolvingDoor;
/* Define Remote Server Context */
rstat = edmiDefineServerContext("MyRemoteServerContext",
"Johnny", "Supervisor", "cf37ftr",
"TCP", "9090", "MyServerHost",
NULL, NULL, NULL, NULL, NULL, &myContext);
/* Select all doors on first floor */
rstat = edmiRemoteSelectInstances(myContext,
"DataRepository", "GeneralHospital",
"DOOR", "FLOOR = 1", SUBTYPES | ONLY_INSTANCE_IDS,
NULL, NULL, NULL, &index, &nHits, &qexRes,
NULL, NULL, NULL, NULL);
/* All doors shall open outwards,
unless already specified otherwise.
Leave revolving doors unchanged */
pInst = qexRes->instanceIds;
while (pInst) {
rstat = edmiRemoteIsInstanceOfBN(myContext,
*pInst, "REVOLVING_DOOR",
&isRevolvingDoor, NULL);
if (! isRevolvingDoor) {
SdaiBoolean *_valSet;
SdaiString _attrName = "OPEN_DIRECTION";
rstat = edmiRemoteTestAttrsBN(myContext, *pInst, 0, 1,
&_attrName, &_valSet, NULL);
if (! _valSet[0]) {
rstat = edmiRemotePutAttrsBN(myContext, *pInst, 1, NULL,
&_attrName, sdaiENUMERATION, "OPENDIR_OUTWARDS");
}
}
}
. . .