• admin

Basics of Teamcenter Query Builder

Query Builder application in Teamcenter allows you to create customized searches for objects in both local and remote Teamcenter databases.


Basics of Query Builder

  • Teamcenter Query is based on Teamcenter persistence data model. Refer Teamcenter Data Model Layer section to understand Teamcenter data model

  • Query is created against any of the Teamcenter persistence class.

  • Query criteria can be defined either on attribute of target object or for the related object which are related to search class through either GRM relation or reference.

  • Referenced-by clauses allows creating query based on reversed-reference relationship. For example, query to find dataset objects that are referenced, through an IMAN_specification relationship, by an item revision with a specific name.

  • Query hints assist user to navigate the schema by presenting a relationship to traverse and the steps required to build the relationships into query definition. For example, item to item-master form.

  • Criteria can be made invisible to end user by making use entry field empty.

  • Predefined keyword variable can be used against some of the attributes. These variable values are executed at runtime. For example keyword variable $USERID will resolve to session userid when query will be executed. Following are the allowed values,

  • $USERID

  • $USERNAME

  • $GROUP

  • $TODAY

  • $NULL

  • Teamcenter also support keyword query which allow to search dataset files content, that contain a specific keyword or combinations of keywords. The IDOL server must be installed and configured at your site to enable full-text keyword search functionality.

  • Create query based on the existing query from the Saved Queries tree.

  • IS_NULL and IS_NOT_NULL operators allows to create queries to find objects with null attribute values. Clauses that use this operator are treated as having a fixed value; therefore, there is no need to enter a name and default value for the clause.

  • Query can be based on classification attributes along with Teamcenter attributes. For Example, Saved query to perform searches using Classification properties and Teamcenter properties.

  • Query can be based on revision rule, named-value properties and table properties.

  • Specify sort order for a saved query.

  • Query can also be customized through Teamcenter user exit. Will blog on how to create user exit query.

  • Query results always shows list of object of class which is defined as search class in query builder.


Creating Query

  • Define Query : Before creating query, you have to first define what exactly required to be search and in what context. Context means some condition or criteria which user can either provide while executing search or defined as basic criteria for search itself. For example, if you want create a query for find specific Data type only, then you defined Object Type is query builder and make the field invisible.

  • Map to Data Model : After defining search requirement , you map it to persistence data model of Teamcenter. This become your search class in Query Builder. Basically the output will be shown for instance of this class only. It is assumed the admin user who will be building the query will be aware of basic data model of Teamcenter. Once you select the Search Class, automatically its attributes and GRM relation are shown in Attribute Display area. The attributes can be filter to show only class specific attributes or all inherited attributes from all parent classes.

  • Define Search Context : Then defined search criteria or context in which search required to happen. For example if you want to get Item Revision which has attachment of specific data set only. In this case you have to traverse from search class i.e Item Revision to Dataset through predefined GRM relation shown in attribute display area or through reference by from imanrelation object to Dataset (Primary object to Secondary Object).

  • Use Search Criteria Field : At last you defined the the criteria which you want to expose to user for executing the search. This defined list of attributes shown to User whose value can be set by user before query execution. The attribute can be of search class or related class.

Search Type Button

Clicking the Search Type button displays the Business Type Selection dialog box, which allows you to navigate and search the Teamcenter POM schema and select types and attributes to use in query definitions.

Search Criteria pane

When you perform your search, Teamcenter examines the attribute specified in each of your search clauses and looks for values that match your search.

  • Boolean Rules: The Boolean rules (AND/OR) are used to combine clauses to create a custom query. When you use AND clauses together, both must be satisfied to return a match (both this clause and that clause). When you use OR clauses together, either can be satisfied to return a match (either this clause or that clause).

  • Attribute: The selected database attribute displays in this box.

  • User Entry L10N Key: Specifies the localization key used to look up user entry names. The value in this column can be modified and must be unique within the search criteria definition.

  • User Entry Name: Displays the query box names as they appear in the search form. The user name is the value of the localization key entered in the User Entry L10N Key column.

  • Logical Operators: Matching values can be equal to, not equal to, less than, or greater than the value specified in your search clause. Matching values can also be null or not null. These conditions are called logical operators.

=    -> Equal to.
!=   -> Not equal to.
>    -> Greater than.
>=   -> Greater than or equal to.
<     -> Less than.
<=    -> Less than or equal to.
IS_NULL -> Indicates that the reference attribute value must be blank (not set).
IS_NOT_NULL-> Indicates that the reference attribute must have a value.
CONTAINS -> Indicates that the reference attribute contains the default value.
  • Default Value: Default values can be specified for the query clauses. Default values can be entered as a text string or selected from the associated list of values, where applicable. After the value is set, press Enter to save the default value

  • $USERID

  • $USERNAME

  • $GROUP

  • $TODAY

  • $NULL

Order By Tab: contains the search criteria elements to define the attribute based on the which you can define the order by ascending or descending.