Searches the specified array (or vector) for the first occurrence of an element that complies with at least one of the specified Element Types.

Parameters:

elements

The array (or vector) to be searched.

Note: The array (or vector) is expected to contain objects representing DSM (Data Source Model) elements, that is GOMElement or DSMElement objects. Objects of any other types will be ignored.

elementTypeSpec
Specifies the list of the target Element Types (see "Specifying Matching Element Types" below).

Note: When the list contains names of non-existent Element Types, the generator will raise an error.

filterQuery
Specify an additional condition on the returned element.

This should be a boolean subquery created with BooleanQuery() function. The subquery will be processed against each initially selected element. It must return true if the element should be returned and false if it should be ignored. The tested element is passed as the generator context element.

Returns:

The first element in the specified array (or vector) that complies both with one of the specified Element Types and with the filter condition (if specified).

If no such an element found (or elements == null), the function returns null.

See Also:

findElementByFilter(), instanceOf(), checkElementType(), resolveElementType(), findElementType(), GOMElement.elementType

${include ../../../refs/matching_ets_spec.htm}