Defining an AccuWorkflow Configuration
Each AccuWork issue database has its own workflow, a directed graph whose nodes (green rectangles) are called workflow stages and whose arrows (with orange labels) are called workflow transitions. Here's an example, which will be used throughout this section.
Each issue record progresses, step by step, through the workflow specified in the issue database schema -- in this example, from stage New to stage Closed. AccuRev users can perform these workflow-related operations:
Determine which issue records are in a given workflow stage, using the Stream Browser or a Queries tab.
Send an individual issue record to another workflow stage by clicking a toolbar button on the AccuWork edit form.
Send a set of issue records to another workflow stage through a drag-and-drop operation. This can have the "side-effect" of promoting the versions in the change package(s) of the issue record(s).
Conversely, promoting the versions in the change package(s) of certain issue record(s) can cause those issue records to transition to another workflow stage.
The components of a workflow are initially defined on the Validation subtab:
Some validation conditions define workflow stages. Each workflow stage can specify a set of workflow transition buttons to be displayed in the AccuWork edit form of issue records that are "in" that stage.
Other validation conditions define "custom actions". Each custom action serves as the name of a workflow transition. Its definition also includes actions to be performed when the workflow transition takes place -- for example, changing field values in the issue record and setting required fields.
On the Workflow subtab, you assemble these components into a complete workflow:
A workflow transition is defined to be a custom action (such as "Schedule", "Finish Dvt", or "Pass QA") and a destination stage (such as "Scheduled", "Implemented", or "Closed"). That is, a workflow transition is not just an arrow -- it's an arrow that points to a particular stage:
You can attach any number of workflow transitions to each workflow stage:
On the Validation subtab, certain validations define workflow stages: if an issue record satisfies the validation condition, AccuWorkflow considers the issue record to be "in" that workflow stage:
After creating a condition containing one or more clauses, you can declare that the condition defines a workflow stage. Invoke the command Use as Workflow Stage from the condition's context menu. Enter a name for the workflow stage in the dialog box that appears. The name is then displayed above the condition, with a special "stage" icon.
If a condition has already been declared to define a workflow stage:
You can return it to being a non-AccuWorkflow condition with the command Use as Workflow Stage. (The command is actually a toggle switch; a green checkmark indicates that the condition currently defines a workflow stage.)
You can rename the workflow stage with the command Edit Workflow Stage.
The user initiates a workflow transition by clicking a button in the toolbar of the issue record's edit form:
The set of validation actions for a workflow stage must explicitly enable the toolbar buttons, using validation actions of type enableAction:
As this example shows, you can define any number of workflow transition buttons for each workflow stage. And you can add actions that set field values, establish field requirements, etc. -- just as with non-workflow-related validations.
Creating a validation action of type enableAction requires several steps:
Declare the "custom action" name (workflow transition name), using the Edit Custom Actions command on the Validation subtab.
Note: the order of the custom actions is significant. It controls the order in which workflow transition buttons will appear in the edit form toolbar (if multiple enableAction validation actions are defined for a workflow stage).
On the Workflow subtab, make sure that a workflow transition has been defined that couples this custom action with a destination stage. See Defining and Configuring Workflow Transitions.
Use the Add Action command to create the enableAction action, specifying the "custom action" name.
The enableAction validation action instantiates a workflow transition button in the edit form toolbar, but it doesn't specify what happens when the user clicks the button. You must make this specification with a separate validation whose condition is the keyword CUSTOM_ACTION.
Continuing the example above, you might configure the "Postpone" and "Finish Dvt" workflow transitions like this:
At minimum, the actions initiated by clicking a workflow transition button should include setting the value(s) of the database field(s) involved in the definition of the destination workflow stage. (In this example, it's the single field wflowStage.)
On the Workflow subtab, you complete the task of configuring an AccuWorkflow. You also configure the queries that user implicitly invoke when determining which issue records are "in" a workflow stage, using the Stream Browser or on a Queries tab.
To define an issue database's set of workflow transitions, click the
Edit Transitions button on the Workflow subtab toolbar. This brings up a dialog box in which you define the workflow transitions as a set of pairs:
One member of each pair is a custom action defined on the Validation subtab with a CUSTOM_ACTION is condition.
The other member of a pair is a workflow stage defined on the Validation subtab with the Use as Workflow Stage command. This is the transition's destination: invoking the workflow transition on an issue record will change it to be "in" this stage.
Each cell in the Stage column is a list-box, containing all the workflow stages.
Each workflow stage can be the "from" stage for any number of workflow transitions. To maintain the set of transitions attached to a stage, choose Select Transition Links from the stage's context menu. Then set/clear any number of the workflow transition's checkboxes:
You can use drag-and-drop to adjust the Workflow subtab diagram -- for example, to prevent items from overlapping each other. The connections among the boxes and arrows of the graph are preserved, no matter where you move items.
To adjust a workflow transition arrow, drag-and-drop the orange label.
Using the Stream Browser or a Queries tab, a user can determine the set of issue records that are "in" a particular stage. AccuRev automatically composes and then executes a workflow query to determine this set of issue records; a particular AccuRev user identity and a particular stream in the issue database's depot can be inputs to this query.
For example, the Stream Browser can display the set of issue records that are in the "In Test" stage:
The workflow query that returns this set of issue records filters on the stream that the user has set as the "current project" (in this example, bear_tst).
The
Setup Workflow Query Fields toolbar button on the Workflow subtab toolbar brings up a dialog box which configures how a stream (and, in some cases, the current AccuRev user identity) in the current context will be used in a workflow query.
If the dialog box settings are as shown in this example ...
... the workflow query will include one or both of these clauses:
assignedTo is john
targetRelease is bear_tst
The User listbox in this dialog box contains all the fields of type User in the issue database schema; likewise, the Stream listbox contains all the fields of type Stream.
See the help screens for the Stream Browser and the Queries tab for details on how workflow queries work in those contexts.