edmiRemoteIsInstanceOf

EdmiError edmiRemoteIsInstanceOf(SdaiServerContext serverContextId,
                                   SdaiInstance      instanceId, 
                                   SdaiEntity        entityId, 
                                   SdaiBoolean       *isInstanceOf, 
                                   SdaiInvocationId  *edmiInvocationId);

Determines whether an instance is an instance of exactly the specified instance type.

Arguments


TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiInstance

instanceId

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

SdaiEntity

entityId

The numeric entityID that uniquely identifies the entity definition instance in a dictionary model in the remote  EDMdatabase

SdaiBoolean

isInstanceOf

A variable that will receive TRUE if the instance given in argument <instanceId> is of the instance type given in the argument <entityId>. Otherwise, FALSE will be returned.

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


  

OptionComment
Option nameComment

 

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.

Â