Working in Standard Query Mode
Working in the Query List pane
Additional Operations in the Query List Pane
Working in the Query Results pane
Commands Available in the Query Results Pane
Working with the Results of a Workflow Query
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.
Choose the Issues > Queries command from the GUI main menu, or click the
button in the GUI main toolbar. A Queries tab opens in either of these modes, whichever was used most recently:
AccuWork's Standard Query mode, which has long been part of the AccuRev GUI.
Workflow Query mode, introduced in AccuRev 4.5 with AccuWorkflow.
Use the buttons at the right side of the toolbar to switch between this mode
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 (AccuWork) A query that appears in the Queries pane only for the user who created it. See public query., along with public queries (AccuWork) A query that appears in the Queries pane for all users. See private query. 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 An AccuWork query that you've designated to be executed automatically in certain situations: when you open a new Queries tab; when AccuRev prompts you to specify one or more issue records in a Send to Issue command; when you execute Promote and an AccuRev/AccuWork integration is enabled. for this issue database, 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.
The Query List pane contains a list of the private queries (AccuWork) A query that appears in the Queries pane only for the user who created it. See public query. you've defined for the current issue database (AccuWork) A set of issue records, each of which implements a bug report, feature description, etc. Each depot can have its own issues database. Each issues database has its own schema., along with any public queries (AccuWork) A query that appears in the Queries pane for all users. See private query. 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. (But you can rearrange the list.)
Your queries (both private and public) are always listed above other users' public queries.
See Working in the Query List pane.
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 (AccuWork) A data record, consisting of values of data fields, stored in an issue database.).
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 ]
See Working in the Query Results pane.
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.
See Working in the Edit Form pane.
Here's a typical Queries tab workflow in Standard Query mode:
In the Query List pane, create a new query (or select an existing one), then execute the query.
In the Query Results pane, view selected fields from the issue records selected by the query.
Open the Edit Form pane to view the entire contents of one of the selected issue records (and perhaps modify it).
The following sections describe working in each of the Queries tab's panes.
Working in the Query List pane
Working in the Query Results 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 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 (click to view):
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.
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 An AccuWork query that you've designated to be executed automatically in certain situations: when you open a new Queries tab; when AccuRev prompts you to specify one or more issue records in a Send to Issue command; when you execute Promote and an AccuRev/AccuWork integration is enabled. for this issue database. [note ] The query name is redisplayed in bold-italic to indicate that it's the default query.
Your default query for an issue database is executed:
Whenever you open a new Queries tab.
When the transaction-level integration The AccuRev facility that records the transaction number of a promote operation in a user-specified AccuWork issue record. This facility is enabled on a depot-by-depot basis by a trigger. between AccuRev and AccuWork is triggered by the Promote command. [more]
When you execute the Send to Issue command.
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.
You can rename any of your private queries in the Query List pane, without having to open an Edit Query window:
Select the query.
Press function key F2 or click the query name again. (Be careful not to double-click; that invokes the Run Query command.)
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.
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 results table is read-only. To modify an issue record, you must access it through its edit form.
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.
The following commands are available in the Query Results pane:
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.)
Open a File Chooser window, in which you specify a file to store the entire contents of the results table. [example]
Toggles whether an Edit Form pane appears, displaying the complete contents of the currently selected record in the Query Results pane.
See also:
AccuRev's standard table-manipulation operations
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:
The browse buttons in the Query Edit Form pane's toolbar makes it easy to visit all the records in the Query Results pane table.
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.
If you are using AccuWorkflow, Workflow Query mode provides a very easy way to analyze issue records by the workflow stage A node in an AccuWork workflow, representing one of the steps in the 'lifetime' of an issue record. See workflow, workflow transition. they belong to. In this mode, the Queries tab is divided into four panes:
The selections you make in the users/groups pane, the streams pane, and/or the workflow pane build a query. In the illustration above, one item is selected (highlighted in blue) in each of these panes, defining a query that returns all issue records for which:
the Assignee is allison
the Target Release is the stream named bear_tst
the issue record is currently in the workflow stage In Dvt
(The query might involve some User-type field other than Assignee, and some Stream-type field other than Target Release. See Issue Record Fields Used in a Workflow Query.)
In the users/groups pane and the streams pane, you can select multiple items, by holding down the Ctrl key while making the additional selections. This defines an OR compound clause, such as:
the Assignee is user allison or userderek
You can also leave one or two of these panes with no item selected. (To deselect an item, click it while holding down the Ctrl key.) This removes that "dimension" from the query. For example, if you don't specify a stream, then the query will choose issue records regardless of their Target Release.
Notes (click to view):
Selecting a group instead of an individual user
Selecting a group (say, famgrp) constructs a query clause like this ...
the Assignee is famgrp
... not like this ...
the Assignee is a member of famgrp
To execute the query according to your current selections, click the toolbar button. Selected fields from the issue records selected by the query appear as a table in the query results pane.
You can work with the issue records selected by a workflow query in some of the same ways as with a Standard Mode query. In particular, you can invoke Open Issue on a single issue record or Export Table on a selected set of issue records.
In addition, drag-and-drop operations provide a "batch update" capability for the configured User-type field and the Stream-type field:
You can drag a set of issue records onto a user or group name. This sets the value of the User-type field (Assignee in the example above) in each issue record to that user or group. Likewise, you can drag a set of issue records onto a stream name. This sets the value of the Stream-type field (Target Release in the example above) in each issue record to that stream. Example:
The User-type or Stream-type field that you change with a drag-and-drop operation does not need to be among the fields displayed in the query results pane.
You can drag a set of issue records onto a workflow transition An arrow in an AccuWork workflow, pointing to a particular workflow stage. This represents one step that an issue record can take through the workflow. A transition has two components: a transition action (such as 'Finish Dvt') and a workflow stage (such as 'Implemented') that is the arrow's destination. Each workflow transition can be configured to start from any number of stages. that it valid for all the issue records, given the workflow stage they are currently in. This transitions each issue record to the destination stage, changing one or more field values according to the definition of the workflow transition. Example:
In the example above, the selected user/group was used as the value of the Assignee field, and the selected stream was used as the value of the Target Release field. The issue record fields to be used in the query are configurable, using the Setup Workflow Query Fields toolbar button on the Workflow subtab of the AccuWork Schema editor.
The issue record field(s) used by the workflow stage selection (in this example, In Dvt) depend on the definition of that workflow stage, on the Validation subtab of the AccuWork Schema editor. For example, the In Dvt stage might be defined in terms of a single issue record field:
wflowStage is In Dvt
Or it might be defined in terms of multiple issue record fields:
AND
state is WIP
status is Scheduled
See chapter "Designing Issue Databases and Edit Forms: The Schema Editor" in the AccuRev Administrator's Guide for details.
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. [example]
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. [example]
In this example, only the stream names bear and bear_tst will appear in the streams pane.