Skip to main content

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.


Related posts:

How to create query on form class



    Comments

    1. How to create a query to search Item Revision based on the attribute value available on the Revision master form?

      ReplyDelete
    2. Hi, thank you for sharing this insightful blog! Your detailed overview of Siemens PLM Teamcenter is incredibly valuable. It’s clear how Teamcenter’s features can significantly enhance product lifecycle management. Looking forward to more posts like this!

      ReplyDelete

    Post a Comment

    Share your feedback

    Popular posts from this blog

    Teamcenter Relations

    Teamcenter Relation objects are created to relate two objects. It connects the primary business object and secondary business object through relation property. Relations are widely used in Teamcenter.  Out of the Box Teamcenter provides various relation objects to relate objects. Always we can create new relations through BMIDE under ImanRelation business object. ImanRelation B.O Steps to create new relation Open BMIDE and load the custom template. Search for ImanRelation in Business object tab. Right click ImanRelation -> New Business Object. Type in the Name (real name) and Display Name (This name will be shown to end user for pseudo folder name). Relation creation window

    Teamcenter custom handler build in BMIDE

      In this blog we can see how to register and build a custom handler through BMIDE. Please refer my previous blog  Setting up BMIDE for coding and building DLL  to set up BMIDE for coding. Register Custom Handler Make sure you have a active library defined in  Extensions\Code Generation folders. If you need a new library for managing handlers, create a new library and make it as active library. Create a custom extension rule. Open the Extensions\Rules folders, right-click the Extensions folder, and choose New Extension Definition.  In Extension dialog box, along with Name of the extension and click the Add button to the right of Availability table. Select the business object as Session, Business object as Type, Operation as BMF_SESSION_register_epm_handlers and Extension Point as BaseAction. Extension availability Click Finish Extension view Add your custom extension as a base action on the BMF_SESSION_register_epm_handlers operation. Open the Session business o...

    Setting up BMIDE for coding and building DLL

      Coding can be done either in external coding platforms like visual studio or using Teamcenter BMIDE application. Siemens suggests BMIDE for coding the server side customization. In this blog, let us see how to set up BMIDE for coding. Set up a Business Modeler IDE project for coding Modify BMIDE.bat file When you install or configure the Business Modeler IDE, set up the JDK location and a compiler application. The bmide.bat file starts the Business Modeler IDE. Set the location of the JDK in the install-location\bmide\client\bmide.bat file. set JRE_HOME=C:\Program Files (x86)\Java\jrex set JAVA_HOME=C:\Program Files (x86)\Java\jdkx.x.x set JDK_HOME=C:\Program Files (x86)\Java\jdkx.x.x Set TC_ROOT variable to Teamcenter installation path. if not defined TC_ROOT set TC_ROOT=C:\Apps\Teamcenter12\TC_ROOT On Windows when Microsoft Visual Studio is used for compiling, a call to the vcvarsall.bat file in the bmide.bat file is required. The call should be before the PATH statement. Add V...

    Teamcenter Batch LOV

      Teamcenter offers 3 types of LOV and based on the use case, choose the LOV type. Unlike Classic and Dynamic LOVs, Batch LOVs are managed externally. To update or remove values from Classic or Dynamic LOV, we need to update LOV via BMIDE and deploy the changes as templates using tem.bat. Where as in Batch LOV, the updates happen using utility and does not require system downtime. Initially Batch LOV should be created in BMIDE and added to the respective property or properties. Once you deploy the batch lov to the database via tem, you can subsequently add values to the LOV using xml and load it into Teamcenter using  bmide_manage_batch_lovs utility. To update existing Batch LOVs, you can extract the existing LOV values through the same utility in XML format, update the xml files and load it back using same utility. Creating new Batch LOV 1. In BMIDE, open Extensions\LOV Folder. Right click Batch LOV folder and choose New Batch LOV. Batch LOV 2. Click Finish 3. Add the Batch ...

    Types of Property in Teamcenter

      Properties contains information describing the business object like name, description and so on. For Example, A screw object can contain properties like name, description, length, diameter, material, etc.  A business object derive its properties from its persistent storage class. In addition to the persistent properties from storage class, business object can also have additional properties like run-time properties, compound properties and relation properties. Properties shown for business object in Rich client Types of Properties Persistent Persistent properties are properties of business objects that remain constant on the object. A simple value (for example, integer, string, or date). The  value is stored in the database as an attribute and mapped to  the property. Run-time A property that is defined at run time and attached to types. Run-time properties are derived each time the property is displayed.  Run-time properties do not map directly to persistent ...

    Teamcenter: Basics of Report Builder

      Teamcenter Report builder module allows to create custom reports based on PLM data from Teamcenter. Teamcenter Reports are mainly based on queries and PLMXML framework. Report definition specifies the data to display in the report. This includes the data source, additional properties to be extracted, and the rules for importing the data. XSL style sheets allow to control the properties you want to display in the report and the display order. They also help to define the look and format of the report. Report Administrators (DBA or non-DBA users) creates and manages the report definitions. End users uses these report definitions to generate various types of reports in Teamcenter or Active Workspace. Optional Teamcenter Reporting and Analytics( TcRA ) standalone application is used to create advanced reports using various data sources.  Types of Reports Summary Reports Summary reports present information based on a Teamcenter saved query definition. No object selection...

    Cascading vs Interdependent LOV

    Cascading LOV  Cascading LOV or hierarchical LOV is an LOV whose values have their own sub-lovs. In Teamcenter, the cascading lovs are display as levels. We can setup multiple levels of values, the final level value selected is stored as property value Foe example, to define city property with cascading lov of st level as country, 2nd level as states and 3rd level as cities.  Steps to create cascading LOV Create a main classic LOV to hold the sub LOV's. All the values of the main LOV should have a sub LOV assigned. For example, in main LOV create with state names as value, then create sub LOV for each state with city names. Main LOV Open the main LOV created in BMIDE. Select the Show Cascading View check box. Cascading LOV view is not shown unless the check box is selected. Select a value in the main LOV and choose sub LOV. In the LOV selection dialog box, select the sub lov. In case not created, create the sub lov for each value in main LOV. Sub LOV Cascading View Attach...

    Teamcenter Preferences

      Teamcenter preferences are settings stored in the Teamcenter database that provide a mechanism to control and define Teamcenter behavior by letting you modify the interface, set default behavior, and specify default values. Use Teamcenter preferences to configure many aspects of a session of application behavior, such as how assemblies are revised, whether extension rules are bypassed for specified operations, and which Teamcenter objects are displayed in integrations. Each application may have associated preferences. They are similar to environment variables, except that they operate with several layers of permissions

    Teamcenter Item Business Object (Item Data Model)

    Items are the fundamental object used to model data in Teamcenter. They are commonly used to identify an element of a product (component, assembly, end item) or other data such as procurement specification, test procedure, standard part, shop tooling, change, and so on. Data modeled using the Item business object is generally revision controlled data and all revisions of the information must be maintained, tracked, and recoverable. Data must also be modeled using the Teamcenter concept of item if you want to build a structure of the items such as a bill of material (BOM) for items that represent a product. Item is the most common business object under which you create a new business object. Use the Item business object or its children when you want to create business objects to represent product parts. When you create a business object using Item (or one of its children) as the parent, in addition to the new business object, system also create an item master form, an item revision, and...