edmiRemoteGetInstancesType
EdmiError edmiRemoteGetInstancesType(SdaiServerContext serverContextId, SdaiAggr aggrId, SdaiInstance *instanceBuffer, SdaiString instancesTypeAttributes, SdaiOptions options, SdaiInstance **instanceTypeBuffer, SdaiQueryResult *instancesTypeProperties, SdaiInstance xmlConfigId, SdaiString resultFileName, SdaiString *xmlString, SdaiInstance **lockContainerIds, SdaiInstance **otherContainers, SdaiInvocationId *edmiInvocationId);
<Description>
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiAggr | aggrId | A numeric aggregateID that uniquely identifies an aggregate in the EDMdatabase |
SdaiInstance | instanceBuffer | A zero-terminated buffer of instanceIds for which to retrieve information. |
SdaiString | instancesTypeAttributes | A string that defines the names of the attributes to retrieve from the entity_definition of each of the instances specified in the <aggrId> or the <instanceBuffer> arguments. Use space, comma or semicolon to separate the column names. |
SdaiOptions | options | See description of available options below. Options may be joined by using bitwise OR operator |
SdaiInstance | instanceTypeBuffer | A variable that will receive the address of a buffer that contains the instance types (entityIds) of each of the instances that are given as input to this function. |
SdaiQueryResult | instancesTypeProperties | A variable that will receive a query result with a column for each attribute that is specified in the <instancesTypeAttributes> argument. This parameter is used only when the option GET_INSTANCE_TYPE_PROPERTIES is set. |
SdaiInstance | xmlConfigId | The XML Configuration Id that uniquely identifies the XML Configuration to be applied to the resulting XML when the option XML_FORMAT is used. |
SdaiString | resultFileName | The name of the file on the local file system that will contain the output from this function when the option RESULT_IN_FILE is used. |
SdaiString | xmlString | A variable that will receive the address of a string that contains the query result when the option RESULT_IN_STRING is used. |
SdaiInstance | lockContainerIds | A variable that will receive the address of a buffer of zeros or containerIds. Each element in the buffer corresponds to the instanceId with the same element position in the <instanceBuffer> or <aggrId> argument. If an instance is contained in a lock container, the containerId will be found at its position in this buffer. This parameter is used only when the option GET_INSTANCE_LOCK_CONTAINER is set. |
SdaiInstance | otherContainers | A variable that will receive the address of a buffer of containerId buffers. For each instance listed in the argument <instanceBuffer> or <aggrId> there will be returned either a NULL pointer or a zero-terminated buffer containing the containerIds of all the instance containers in which the given instance is contained. This parameter is used only when the option GET_INSTANCE_CONTAINERS_INFO is set. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Â
Options
 Â
Option | Comment |
INCLUDE_CONFIGURATION | Include configuration element when writing an ISO_10303_28 compliant document. |
INCLUDE_SCHEMA | Include schema elements when writing an ISO_10303_28 compliant document. |
RESULT_IN_STRING | The resulting table will be returned in a string allocated in heap-memory of the calling application. Use the option RESULT_IN_FILE to write the table to a file. |
EXTRACT_SHALLOW | Use this option to force a shallow XML formatted query result. ISO10303-28 compliant XML Query results are deep by default. No other query result format supported by this function is deep. Hence, this option has no effect unless combined with the option XML_FORMAT. |
INCLUDE_INSTANCE_IDS | Prepend all attribute columns in the query result with an instanceId column. |
RESULT_IN_FILE | The resulting table will be written to a file on the local file system of the calling application. The name of the file must be specified in the <resultFileName> argument |
EDM_IDENTIFIERS | The instanceIds that uniquely identify the instances in the remote EDMdatabase will be used as xmlIds for identification of the instances within the ISO10303-28 compliant XML formatted query result. |
GET_INSTANCE_LOCK_CONTAINER | Activates the return parameter <lockContainerIds>. |
GET_INSTANCE_CONTAINERS_INFO | Activates the return parameter <otherContainers>. |
HTML_FORMAT | The query result table will be presented in HTML format in a locally allocated string or in a file on the local file system. See the options RESULT_IN_FILE and RESULT_IN_STRING. |
ASCII_FORMAT | The query result table will be presented in plain ASCII format in a locally allocated string or in a file on the local file system. See the options RESULT_IN_FILE and RESULT_IN_STRING. |
GET_INSTANCE_TYPE_PROPERTIES | Activates the return parameter <instancesTypeProperties>. |
OLD_XML_FORMAT | The result of the query will be returned in a simple wellformed XML formatted file on the local file system. |
XML_FORMAT | The result of the query will be returned in an ISO10303-28 compliant XML formatted string or in a file on the local file system. |
ZIPPED_FILE | The file given by the argument <resultFileName> will be compressed. This option has no effect unless combined with the option RESULT_IN_FILE. |
IGNORE_EMPTY_COLUMNS | Columns for attributes that do not have defined values for any of the returned instances will be left out of the query result table. |
Â
Example
Â
 int i; EdmiError rstat; SdaiModel modelId; SdaiContainer contId; SdaiServerContext myContext; SdaiQueryResult qexRes1, qexRes2; SdaiInteger index = 0, nHits = 10000; SdaiEntity *entityIds; SdaiInstance **allContIds, *lockContIds; SdaiBoolean problem; /* Define Remote Server Context */ rstat = edmiDefineServerContext("MyServerContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Create a lock container */ rstat = edmiRemoteCreateInstanceContainer(myContext, modelId, MODEL_LOCK_CONTAINER, "FLOOR01", "Check out of first floor", &contId, NULL); /* Select instances to lock */ rstat = edmiRemoteSelectInstances(myContext, "DataRepository", "GeneralHospital", "CONSTRUCTION_ELEMENT", "FLOOR = 1", SUBTYPES | ONLY_INSTANCE_IDS, NULL, NULL, NULL, &index, &nHits, &qexRes1, NULL, NULL, NULL, NULL); /* Are any of them locked already? */ rstat = edmiRemoteGetInstancesType(myContext, 0, qexRes1->instanceIds, "NAME", GET_INSTANCES_LOCK_CONTAINER | GET_INSTANCE_TYPE_PROPERTIES, &entityIds, &qexRes2, 0, NULL, NULL, &lockContIds, &allContIds, NULL); i = 0; problem = false; while(qexRes1->instanceIds[i]) { if (lockContIds[i]) { SdaiString pString = (SdaiString) qexRes2->columnDescr[0]->pvalue; printf("ERROR: Instance %d (%s) already locked.", qexRes1->instanceIds[i], pString[i]); problem = true; } i++; } edmiFreeQueryResult(qexRes2); if (problem) { printf("\nCheck out operation aborted!"); goto err; } /* Put first floor in the container */ rstat = edmiRemoteInstancesToContainer(myContext, 0, contId, 0, qexRes1->instanceIds, NULL); edmiFreeQueryResult(qexRes1); /* Check out the container */ rstat = edmiRemoteProtectInstance(myContext, contId, (PUBLIC_READ | GROUP_READ | OWNER_WRITE), NULL); rstat = edmiRemoteSetContainerCheckedout(myContext, contId, NULL); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â