Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Returns the set/unset status of an array element identified by its element index. This function is only applicable on aggregates of array type.
Related functions: edmiRemoteTestAggrElements.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteTestAggrElement(SdaiServerContext serverContextId,
                                     SdaiAggr          aggrId, 
                                     SdaiVersion       version, 
                                     SdaiAggrIndex     index, 
                                     SdaiBoolean       *isSet,
                                     SdaiInvocationId  *edmiInvocationId); 
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

aggrId

The numeric aggregateID that uniquely identifies the array for which to test an indexed element.

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.

index

The index of the array element to test.

isSet

A variable that will receive an SdaiBoolean value that indicate whether the aggregate element is set or unset. sdaiTRUE means the element with the given index is set. sdaiFALSE means it is unset.

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:
/*
SCHEMA DentalStatus; 
ENTITY Tooth; 
Fillings : INTEGER; 
END_ENTITY; 
ENTITY Incisor SUBTYPE OF (Tooth); END_ENTITY; 
ENTITY Canin SUBTYPE OF (Tooth); END_ENTITY; 
ENTITY Molar SUBTYPE OF (Tooth); END_ENTITY; 
ENTITY Wisdom SUBTYPE OF (Molar); END_ENTITY; 
ENTITY Patient; 
CustomerId : INTEGER; 
ToothSet : ARRAY [1:32] OF OPTIONAL Tooth; 
END_ENTITY; 
END_SCHEMA; 
*/
EdmiError rstat;
SdaiServerContext myContext;
SdaiModel modelId;
SdaiInteger nHits, index;
SdaiBoolean inPlace;
SdaiInstance patientId;
SdaiAggr toothSet;
 
/* Define Remote Server Context */
rstat = edmiDefineServerContext("MyRemoteServerContext",
"Johnny", "Dentist", "cf37ftr", 
"TCP", "9090", "MyServerHost", 
NULL, NULL, NULL, NULL, NULL, &myContext); 
 
/* Get the modelId of the
patient register model */ 
rstat = edmiRemoteGetModelBN(myContext, "DataRepository",
"PatientRegister", &modelId, NULL); 
 
/* Get the instance Id of the patient
with customerId 8745 */ 
nHits = 1;
index = 0;
rstat = edmiRemoteFindInstancesBN(myContext, modelId,
"Patient", "CustomerId = 8745", 
sizeof(SdaiInstance), &index, &nHits, 
&patientId, NULL); 
 
/* Get the patients toothset */
rstat = edmiRemoteGetAttrsBN(myContext, patientId, 0, 1, NULL,
"ToothSet", sdaiAGGR, &toothSet); 
 
/* Check if the patient has got his upper left
wisdom molar (toothSet element 1) intact */ 
rstat = edmiRemoteTestAggrElement(myContext, toothSet,
0, 1, &inPlace, NULL); 
printf("\nThe upper left wisdom molar is %s.",
inPlace ? "intact" : "missing"); 
. . .

  • No labels