edmiRemoteGetInstance
EdmiError edmiRemoteGetInstance (SdaiServerContext serverContextId, SdaiInstance instanceId, SdaiVersion version, SdaiInteger options, SdaiQueryResult *queryResult, SdaiString xmlConfigurationName, SdaiString *xmlString, SdaiString resultFileName, SdaiInvocationId *edmiInvocationId);
Retrieve all attributes of a single application instance identified by its instanceId. The result may be returned in three different ways;
- In a query result data structure.
- In a locally allocated string.
- In a file on the local file system.
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> 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. |
SdaiInteger | options | See description of available options below. Options may be joined by using bitwise OR operator |
SdaiQueryResult | queryResult | A variable that will receive the result of the query. Use edmiFreeQueryResult to release allocated memory. |
SdaiString | xmlConfigurationName | The name of the XML configuration to apply to the resulting XML formatted query result when the option XML_FORMAT is used. |
SdaiString | xmlString | Variable that will receive the returned XML, HTML or ASCII formatted query result when the option RESULT_IN_STRING is used with one of the options HTML_FORMAT, ASCII_FORMAT or XML_FORMAT. |
SdaiString | resultFileName | The name of the file that will contain the returned XML, HTML or ASCII formatted query result. Only applicable when using the RESULT_IN_FILE option in combination with one of the options HTML_FORMAT, ASCII_FORMAT or XML_FORMAT. Use the ZIPPED_FILE option to compress the generated file. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Options
 Â
Option | Comment |
INCLUDE_CONFIGURATION | Include configuration element when writing ISO_10303_28 document |
INCLUDE_SCHEMA | Include schema elements when writing ISO_10303_28 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 the 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. |
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. |
OLD_XML_FORMAT | The result of the query will be returned in a simple well formed 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. |
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
 EdmiError rstat; SdaiServerContext myContext; SdaiInteger index, nHits; SdaiQueryResult qexRes; SdaiInstance johnnysId; SdaiOptions options; SdaiString resultStr; /* Create Server Context */ rstat = edmiDefineServerContext("MyContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Get Johnnys PERSON instance Id from his primary key attribute 'PID' */ nHits = 1; index = 0; rstat = edmiRemoteSelectInstances(myContext, "DataRepository", "SocialRelations", "Person", "PID = '16126353127'", (ONLY_INSTANCE_IDS | SUBTYPES), NULL, NULL, NULL, &index, &nHits, &qexRes, NULL, NULL, NULL, NULL); if (!nHits) { printf("\nRequested pid not found."); goto err; } johnnysId = qexRes->instanceIds[0]; edmiFreeQueryResult(qexRes); /* Get an ASCII formatted string with all set attributes of the johnnysId instance */ options = ASCII_FORMAT; options |= IGNORE_EMPTY_COLUMNS; options |= INCLUDE_INSTANCE_IDS; rstat = edmiRemoteGetInstance(myContext, johnnysId, 0, options, &qexRes, NULL, &resultStr, NULL, NULL); printf("\n%s", resultStr); edmiFreeQueryResult(qexRes); edmiFree(resultStr); . . .
See also
Filter by label
There are no items with the selected labels at this time.