edmiRemoteTestAttrs
EdmiError edmiRemoteTestAttrs(SdaiServerContext serverContextId, SdaiInstance instanceId, SdaiVersion version, SdaiInteger attributes, SdaiAttr attributeIds[], SdaiBoolean **valueSet, SdaiInvocationId *edmiInvocationId);
Determines whether one ore more attributes, identified by their attributeIds, of a specified instance, identified by its instanceId, are unset or have been assigned values. The attributeIds are specified in the input buffer argument <attributeIds>. 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.
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiInstance | instanceId | 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 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. |
SdaiInteger | attributes | The number of attributeIds in the <attributeIds> argument. |
SdaiAttr | attributeIds[] | A buffer containing all the attributeIds to be checked. |
SdaiBoolean | 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 <attributeIds> argument. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Â
Options
 Â
Â
Example
Â
 EdmiError rstat; SdaiServerContext myContext; SdaiQueryResult qexRes; SdaiInstance *pInst; SdaiInteger index = 0, nHits = 10000; SdaiBoolean isRevolvingDoor; SdaiModel modelId; SdaiEntity revolvingDoorEID; SdaiAttr openDirAID; /* Define Remote Server Context */ rstat = edmiDefineServerContext("MyRemoteServerContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Get the model Id */ rstat = edmiRemoteGetModelBN(myContext, "DataRepository", "GeneralHospital", &modelId, NULL); /* Get Revolving Door entity Id */ rstat = edmiRemoteGetEntity(myContext, modelId, "REVOLVING_DOOR", &revolvingDoorEID, NULL); /* Get Open Direction attribute Id */ rstat = edmiRemoteGetAttrDefinitionBN(myContext, "GeneralHospital", "DOOR", "OPEN_DIRECTION", &openDirAID, NULL); /* 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 = edmiRemoteIsInstanceOf(myContext, *pInst, revolvingDoorEID, &isRevolvingDoor, NULL); if (! isRevolvingDoor) { SdaiBoolean *_valSet; rstat = edmiRemoteTestAttrs(myContext, *pInst, 0, 1, &openDirAID, &_valSet, NULL); if (! _valSet[0]) { rstat = edmiRemotePutAttrsBN(myContext, *pInst, 1, NULL, &openDirAID, sdaiENUMERATION, "OPENDIR_OUTWARDS"); } } } . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â