B. AccuWork : Issue Record Queries

Issue Record Queries
The AccuWork Queries Tab
An AccuWork query retrieves a set of records according to user-defined selection criteria. AccuWork has a point-and-click interface for creating and editing queries; it enables you to create simple queries quickly, and to create sophisticated queries in a straightforward, reliable way.
By default, the queries that you create are private queries, which cannot be seen by other users. You can declare any query to be a public query. Such queries are visible to all users, who can use and copy them, but cannot modify your original.
Opening a Queries Tab
Choose the Issues > Queries command from the GUI main menu, or click the button in the GUI main toolbar.
A Queries tab opens.
Query Mode Layout
In Standard Query mode, the Queries tab includes two (and sometimes three) panes, each with its own toolbar:
The Query List pane lists the names of all your existing private queries, along with public queries available to all users. Using the toolbar in this pane, you compose new queries, view/revise/rearrange/execute existing queries, and delete queries.
When you execute a query, the set of issue records selected by the query are displayed as a results table in the Query Results pane. If you've set a default query for this depot, it's executed automatically when you open the Queries tab.
If you click the Show Issue Form button in the toolbar of the Query Results pane, an Edit Form pane appears below it. This pane is a fully functional edit form, which you can use to view and modify the issue record currently selected in the Query Results pane. A user preference (Tools > Preferences) configures this pane to appear automatically when you open a Queries tab.
Query List Pane Layout
The Query List pane contains a list of the private queries you've defined for the current depot, along with any public queries defined by you and/or other users.
The listing is not alphabetical -- whenever you create a new query, it's simply added to the end of the list.
Your queries (both private and public) are always listed above other users' public queries.
See Working in the Query List Pane on page 289.
Query Results Pane Layout
The Query Results pane contains a table that displays the results of a query.
Each row of the table displays one issue record; each column displays a particular issue-record field.
Each query has its own results-table design: a set of columns (fields), in a particular order and with particular column-widths. The results table’s design can also include a single-level or multiple-level sort order for the rows (issue records).
When you create a new query, AccuWork automatically starts off the results table with a couple of columns, including Issue (issueNum field). You can add more columns at any time. You can also remove the Issue column from the table. Note: "Issue" is the default label for the issueNum field, but the edit-form designer can change the label.
See Working in the Query Results Pane on page 291.
Edit Form Pane Layout
The Edit Form pane is just like the "full size" Edit Form tab, except that it occupies a pane within the Queries tab, instead of having an entire tab to itself. This pane displays the entire contents of the issue record that's currently selected in the Query Results pane. In addition, browse arrows are enabled in the Edit Form pane's toolbar, making it easy to view some or all of the records selected by a query. There is also a Change Package History icon ( ) that displays all the modifications that have been made to the change package for this issue. In the upper-right corner, the Issue URL link allows you to easily capture a URL to the current issue, using the WebUI. To configure this feature, create or edit:
<accurev_install_dir>\storage\site_slice\dispatch\config\settings.xml
to contain the following entry (customized for your specific installation) to point to your WebUI server:
<settings>
    <webui url="http://<webui-host>:<port>/accurev"/>
</settings>
To use this feature, either click Issue URL to bring up the issue in the WebUI, or to simply copy the URL to send to somebody else,  right-click Issue URL and then select and copy the URL from the resulting dialogbox.
See Working in the Edit Form Pane on page 292.
Working in Query Mode
Here's a typical Queries tab procedure:
1.
2.
3.
The following sections describe working in each of the Queries tab's panes.
Working in the Query List Pane
You can invoke the following commands in the Query List pane, using context menus or the Query List toolbar. Most commands operate on the currently selected query.
Run query
(equivalent: double-click the query name) Executes (or re-executes) the selected query, displaying the results in the Query Results pane. You don't need to run this command when you revise a query in the Edit Query window -- AccuWork automatically executes the revised query and updates the results table.
Save all queries
Save all your private queries. (There is no way to save a single query.) Your private queries are stored in the AccuRev repository within the depot directory, in an XML-format file:
.../storage/<depot-name>/dispatch/config/user/<username>/query.xml
Notes:
Each user's private queries are stored separately
The <username> directory in the query storage pathname causes the private queries for each user to be stored separately.
Queries not version-controlled
Although your queries are stored in the depot, they are not version-controlled in the way AccuRev files are. For example, there is no command that displays or reinstates your queries as you saved them two days ago.
Automatic save-on-close feature
If you try to close a Queries tab in which you've made changes to one or more queries, but haven't run the Save all queries command, AccuWork offers to perform the save.
New query
Edit query
Create a new query or revise an existing one, using the Edit Query window.
Clone query
Create a private query that is a copy of the selected private or public query. The new query is initially named "Copy of ...", but you can change the name.
Move query up
Move query down
Change the position of the selected query in the Query List pane. Note that your own queries (both private and public) are always listed above other users' public queries.
Delete query
Remove the currently selected query. The deletion does not take effect until you run the Save all queries command. If you close the Queries tab without saving your queries, the "deleted" query will still exist the next time you open the Queries tab. This may or may not be the right thing to do: closing the Queries tab without saving also discards changes you've made to other queries since the most recent save.
Set as Default
Disable as Default
Designates one of your private queries to be -- or to stop being -- your default query for this depot. (This is your default query -- another user can set one of his own private queries to be his default query.)
The query name is redisplayed in bold-italic to indicate that it is the default query.
Your default query is executed:
When the transaction-level integration between AccuRev and AccuWork is triggered by the Promote command (see Transaction-Level Integration between AccuRev and AccuWork on page 329).
A query loses its status as your default query when you run Disable as Default on it, or when you select another query as the default.
Set as Private
Set as Public
Changes a query that you created from public to private, or vice-versa.
Additional Operations in the Query List Pane
Renaming a Query—You can rename any of your private queries in the Query List pane, without having to open an Edit Query window:
1.
2.
Press function key F2 or click the query name again. (Be careful not to double-click; that invokes the Run Query command.)
Revisiting the Results of a Query—Whenever you select a particular query in the Query List pane, the Query Results pane displays that query's most recent results. The cache of previous query results is cleared when you close the Queries tab.
Working in the Query Results Pane
In many cases, browsing the results table produced by running a query may be all you need to do. But in other cases, you may want to see a selected issue record in the context of its edit form. Why?
The data you need may be in a field that is not included in the results table. Instead of adding a column to the results table, you can use the edit form to display all the fields.
You can use a "full-size" or "reduced-size" edit form to view a issue record:
Invoke the Open Issue command to open a separate Edit Form tab on the currently selected issue record.
Invoke the Show Issue Form command to make an Edit Form pane appear within the Queries tab.
With either tool, browse arrows in the edit form's toolbar make it easy to view some or all of the records in the results table.
Commands Available in the Query Results Pane
The following commands are available in the Query Results pane:
Open Issue
Open a separate Edit Form tab to view/revise the currently selected issue record.
Setup Columns
Open a Columns window, in which you can change which columns (fields) appear in the table, and also change their order.
Remove Column
(appears only in the context menu of an individual column) Removes the column you right-clicked from the results table. (This is a shortcut, eliminating the need to invoke the Setup Columns command.)
Export Table
Open a File Chooser window, in which you specify a file to store the entire contents of the results table:
Show Issue Form
Toggles whether an Edit Form pane appears, displaying the complete contents of the currently selected record in the Query Results pane.
See also: Working with Tables on page 9.
Working in the Edit Form Pane
Using a "reduced-size" edit form within a pane of the Queries tab is virtually the same as using a "full-size" edit form in its own tab. Here are some notes on the few differences:
After modifying a record and invoking the Save command, you may want to rerun the query in order to update the table in the Query Results pane. This doesn't occur automatically.
Configuring the Users/Groups and Streams Panes
You can choose which user and group names appear in the users/groups pane, and which stream names appear in the streams pane:
Use the Setup User/Group List toolbar button to bring up a dialog box in which you select the items to appear in the users/groups pane.
In this example, only the group name famgrp and the name of each member of famgrp will appear in the users/groups pane.
Use the Setup Stream List toolbar button to bring up a dialog box in which you select the items to appear in the streams pane.
In this example, only the stream names bear and bear_tst will appear in the streams pane.

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com