Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Argument::

Description:

aggrId

A numeric aggregateID that uniquely identifies the aggregate of interest in the EDMdatabase. This may be any type of aggregate, persistant, volatile or scratch.

modelVersion

The version of the edmModel to apply this function call on. The <modelVersion> 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.

condition

A conditional statement, written in Express-X, that the instances shall match.
A valid condition is any Express-X logical expression that refers to any number of attributes defined for the type of instance that is stored in the aggregate element. The instances in the aggregate elements may be of different types. Instances that do not possess all the attributes that are being referred to in the <condition> argument will allways evaluate to sdaiUNKNOWN. These elements are considered not matching. The logical expression may also refer to attributes of referenced instances by using dot-notation.
Example conditions:
?xpxTRUE?
Equivalent to NULL or empty string.
?(NAME LIKE JOHN%) AND (AGE > 30)?
Maches Johnny and Johnatan if they are older than 30 years.
?WIFE.MOTHER.DOG.NAME = Fido?
Matches all men with a mother in law that owns a dog named Fido.
Note that references to the element it self may be done by the symbol SELF. A string comparing condition may therefore be written
?SELF.LastName = SCHMIDT?
or simply
?LastName = SCHMIDT?

options

The options are equivalent to the options used in the EDMinterface function edmiSelectAggrElements except for the XPX prefix

attributes

Specification of the name and contents of each column of the returned query result table. The following examples illustrate the SYNTAX.
?NAME SEX AGE?
The attributes name, sex and age will be returned in column 1, 2 and 3 of the returned query table. The title of the columns will be NAME, SEX and AGE respectively.
?NAME,WIFE.MOTHER.DOG.NAME->DOG?
The first column will contain the mans name. The second column will contain the mans mother in laws dogs name. The title of the columns will be NAME and DOG respectively.
?DOG.NAME->DOG;xpfGetMemberCount(DOG.PUPPIES)->PUPPIES?
The first column will contain the dogs name. The second column will contain its number of puppies. The title of the columns will be DOG and PUPPIES respectively.
Whitespace, comma end semicolon are all used as field delimiters.

include_exclude_filter

The numeric id of an aggregate containing the names or ids of the entities that will be affected by this filter. If the option xpxFILTER_AS_ENTITY_IDS is used, this parameter will be interpreted as an aggregate of instance ids, each defining an entity. If the option xpxFILTER_AS_ENTITY_NAMES is used, this parameter will be interpreted as an aggregate containing entity names. If the option xpxINCLUDE_FILTER is used, no instances but those of a type contained in the aggregate will be included. If the option xpxEXCLUDE_FILTER is used, all instances but those of a type contained in the aggregate will be included.

orderBy

Name of the query result column to use for sorting. The column may be specified by its constructor or by the column title. If the <attributes> argument is: ?DOG.NAME->DOG?, the order by argument may be either ?DOG? or ?DOG.NAME?.This argument is only aplicable when one of the options xpxHTML_FORMAT or xpxASCII_FORMAT is used. Use the options xpxASCENDING and xpxDESCENDING to specify the sorting direction.

firstIndex

The index of the aggregate element to start searching at. The index of the first element in the actual aggregate will always be index zero, independent of the aggregate type. Hence the legal index range is: 0<= index < number of elements in the aggregate.

maxHits

Specifies the maximum number of matching instances to return in the <resultString> or in the query result.

xmlConfigurationName

The name of the XML configuration to apply to the resulting XML formatted query result when the option xpxXML_FORMAT is used.

resultFileName

The name of the file that will contain the returned XML, HTML or ASCII formatted query result. Only applicable when using the xpxRESULT_IN_FILE option in combination with one of the options xpxHTML_FORMAT, xpxASCII_FORMAT or xpxXML_FORMAT. Use the xpxZIPPED_FILE option to compress the generated file.

indexOfLastFound

The index of the ?last returned matching element?. This argument enables the caller to search for instances in an incremental way by specifying this returned ?index value plus one? as the input to the next xpxSelectAggrInstancesEx function and so on.

actualHits

The number of found matching instances.

queryResultIndex

The index that may be used to identify the queryResult that was generated by the call to this procedure. is used to specify the actual EDMinstanceHashTable.

On input : queryResultIndex = 0 : the resulting instances will be inserted in a new EDMinstanceHashTable.

               queryResultIndex != 0: Specifies an actual existing EDMinstanceHashTable, i.e., the resulting instances will be inserted (added) to the specified EDMinstanceHashTable

On return: queryResultIndex : The actual  EDMinstanceHashTable index that holds the resulting instances.

resultString

Variable that will receive the returned XML formatted query result when the options xpxRESULT_IN_STRING and xpxXML_FORMAT are used.

...

Option:

Description:

xpxALL_ATTRIBUTES

When the argument <attributes> is unset or an empty string, all attributes of the instances will be included in the query result. However, if the <attributes> argument is used to add one or more aditional constructed columns or to rename a column in the query result, the return of all the instance attributes will be hindered due to an <attributes> argument that is no longer unset or an empty string. Use this option to force the including of all instance attributes even when the <attributes> argument is not unset or an empty string.

xpxINCLUDE_CONFIGURATION

Includes the XML Configuration in the generated ISO10303-28 compliant XML formatted query result. This option has no effect unless combined with the option xpxXML_FORMAT

xpxINCLUDE_SCHEMA

Includes the underlying meta data in the generated ISO10303-28 compliant XML formatted query result. This option has no effect unless combined with the option xpxXML_FORMAT.

xpxRESULT_IN_STRING

The resulting table will be returned in a string. Must be used in combination with xpxXML_FORMAT

xpxEXTRACT_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 xpxXML_FORMAT.

xpxTRANSFER_NO_DATA

No actual query result will be returned. Use this option when the number of matching elements is the only information needed or for testing the query SYNTAX before actually performing it.

xpxASCENDING

Arrange the query result in ascending order. This option is only applicable when the <orderBy> argument is used.

xpxDESCENDING

Arrange the query result in descending order. This option is only applicable when the <orderBy> argument is used.

xpxONLY_INSTANCE_IDS

Return only a single column with the instanceIds of the matcing instances.

xpxINCLUDE_INSTANCE_IDS

Prepend all attribute columns in the query result with an instanceId column.

xpxINCLUDE_FILTER

Only the aggregate elements of types that are explicitely listed in the <include_exclude_filter> argument will be checked.

xpxEXCLUDE_FILTER

All the aggregate elements, but those of types that are explicitely listed in the <include_exclude_filter> argument, will be checked.

xpxRESULT_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.

xpxEDM_IDENTIFIERS

The instanceIds that uniquely identify the instances in EDMdatabase will be used as xmlIds for identification of the instances within the ISO10303-28 compliant XML formatted query result.

xpxFILTER_AS_ENTITY_NAMES

The <include_exclude_filter> argument will be interpreted as an aggregate of entity names.

xpxFILTER_AS_ENTITY_IDS

The <include_exclude_filter> argument will be interpreted as an aggregate of entityIds.

xpxHTML_FORMAT

The query result table will be written to an HTML formatted file on the local file system.

xpxASCII_FORMAT

The query result table will be written to a plain ASCII formatted file on the local file system.

xpxONLY_ELEMENT_INDEXES

The query result table will contain only one column with the index of all the matching elements.

xpxOLD_XML_FORMAT

The result of the query will be written to a simple wellformed XML formatted file on the local file system.

xpxXML_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.

xpxZIPPED_FILE

The file given by the argument <resultFileName> will be compressed with gzip. This option has no effect unless combined with the option [xpxRESULT_IN_FILE].

xpxIGNORE_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.

xpxRESULT_IN_INSTANCE_HASH_TABLEinsert the resulting instances in an EDMinstanceHashTable

 
Example:
 
. . .
 
firstIndex = 1;
maxHits := 10;
actualHits := maxHits;
 
WHEN (actualHits = maxHits);
BEGIN
stat := xpxSelectAggrInstancesEx (myAggrId, 0,
?SELF.WIFE.FIRST_NAME LIKE Lucy?,
xpxRESULT_IN_STRING + xpxASCENDING,
?FirstName, LastName, Address?, 0, ?LastName?,
firstIndex, maxHits, ??, ??, lastFound, actualHits,
0, resultString);
 
(* Process the result string here *)
 
firstIndex := lastMatch + 1;
END;
 
. . .