IBM Certification Test 992.5 - Queries and Reports
How to Utilize custom queries
Queries
Queries allow you to extract and view information on elements of your models.
Queries return information about model elements of one specified type. You can use queries to confirm that the content of your models accurately represents your business, to gather required information for making business decisions, to document and disseminate specific types of information, and to define the content that you can use for creating reports.
The Query Builder allows you to create queries. Within a query that you create, you can use expressions to get information on the specific model elements that interest you. For example, you can create a query that retrieves all the individual resources that have a cost per time unit of $20.00 or less. For each resource, you can define what type of information the query should display, such as the name, the cost per time unit, and roles for which the resource is qualified.
A variety of predefined queries is also available.
When to use queries versus reports
All predefined queries have a corresponding predefined report based on the query. Use the query if you simply want to view the information within WebSphere® Business Modeler, and use the report if you want to print or save the information.
Creating queries
If the predefined queries do not provide you the information that you need, then you can use the Query Builder to create a custom query.
To create a query, complete the following steps:
-
In the Project Tree view, select the Queries node.
- Right-click the node and then select . A wizard appears.
- Enter the name of the query in the Name of new query field.
- Enter a description of the query in the Description of new query field.
- Click Finish. The Query Builder appears.
- Define the scope of the query: The scope determines which elements of your project are referenced when you run the query.
- To reset the scope each time you run the query, click Define the scope when running the query.
- To query the same element or catalog each time you run the query, click Select Scope and then select a model element or a catalog.
Note: When creating a query for a report, the scope of any query must remain inside a single project and cannot span projects, even if those projects are part of the same project group. Queries that do point to sources in a different project will not provide data when a report is generated.
- In the Search for type drop-down list, select the type of element for which you want to extract information. The type may be a category of model element that appears in the Project Tree view (such as business item), a customized definition (such as a resource definition for Temporary Employee) or a part of a model element (such as connection, which is part of a process model).
Note: If the scope you selected in the previous step does not contain any elements that can be queried, the list is blank.
- Optionally, specify a criterion for the query results. You can use a criterion to return only results for types that have a particular value for one of their attributes.
For queries being created for the Basic profile, specify a criterion as follows:
- Select an attribute from the Attribute list.
- Enter the value that you want to query for in the Value field. The query will only return results for types that have the value you specified for the attribute you selected.
For queries being created for the Intermediate or Advanced profiles, specify a criterion as follows:
- Click Edit Expression to open the Expression Editor, which you can use to edit the expression associated with the criterion. (See Creating expressions)
- In the Results definition select the field or fields, corresponding to the attributes defined by the type of element you selected, that you want the query to return .
For queries being created for the Basic profile, select fields as follows:
- Select one or more fields in the Name column. By default, all fields are selected.
For queries being created for the Intermediate or Advanced profiles, select fields as follows:
- To define individual fields to display in the query results, select Query results definition.
Note: If you do not select Query results definition, the query will display fields for each attribute of the elements it displays.
- Click Add to define a new field to display in the query. A new line is added to the table.
- Double-click in the Name column of the new line, and type the name for the field.
- Double-click in the Expression column of the new line, and then click the button that appears to open the Expression Editor, which you can use to define what information to display in the field. Typically, you will select Modeling artifact for the first term and then select an attribute of the element to create a single term expression, but you can also create other types of expressions. For example, your query could display true or false depending on whether an attribute of a returned element matches a binary expression that you specify. (See Creating expressions)
- Click to save your query.
You have completed creating a new query. You can now run the query in the same way as you would run a predefined query.
No comments:
Post a Comment