Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 16

Lab 6

ClearQuest® Customization - Fields and Forms


The purpose of this Laboratory is to modify fields and forms. You will create new fields
and add them to the Submit form and the Record form. Also, you will use the
parent/child control on the forms to create a link between records.

Objectives
In this Lab, you will have the chance to experience the flexibility of schema
customization in Rational ® ClearQuest® without resorting to scripting.
Here are the tasks that you will perform:
 Add a new field that is required for every defect submission.
 Add a parent/child control to allow users to link defect records.
 Create a record family type that has Defect and EnhancementRequest as its
members.
 Run a multi-record type query.

Exercise 6.1: Add a mandatory field to ClearQuest forms.

The purpose of this exercise is to add a mandatory field to ClearQuest forms.

Here are the tasks that you will perform:

1. Create a new field for Defect record type, and name it user_number.

2. Assign the behavior of the user_number field to be MANDATORY during the


Submit action.

3. Add the new field user_number to both the Submit form and the Record form of
Defect record type.

4. Test the new field functions in the test database.

5. Check in the modified schema version.

6. Upgrade the user database my_db with the new schema version.

© Copyright IBM Corp. 2003 6 - 1


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

Solution for Exercise 6.1

The following set of steps is one of the ways to approach the above tasks. You can use
these steps to accomplish the tasks listed in this exercise, or create your own. TASK 1 –
Create a new field for Defect record type, and name it “user_number.”

1. Click Start > Programs > Rational ClearQuest > Rational ClearQuest
Designer.

2. If the Rational ClearQuest Schema Repository dialog box appears, select


2003.06.00 by highlighting it and click Next. Otherwise, skip to step 3.

3. In the ClearQuest Designer Login dialog box, type “admin” as the user name,
and leave the Password field blank. Click OK.

4. Select my_schema in the Open Schema Wizard. (Note that the latest version is
version 3.) Click Next.

5. In the Comment field, type “Add a new field called user_number.” Click Finish.

6. The schema my_schema, version 4 appears in the Workspace.

7. In the Workspace, click Record Types > Defect.

8. Double-click Fields. The ClearQuest Designer displays the Fields table in the right
pane.

9. Click Edit > Add Field.

10. In the Defect Fields dialog box:

a. On the General tab, type “user_number” in the Field Name field. Select
INT in the Type field.

b. On the Help Text tab, type “This field contains your user number. It
has to be an integer.”

Close the dialog box to apply the changes.

11. Close the Fields table.

TASK 2 – Assign the behavior of the “user_number” field to be MANDATORY


during a Submit action.

12. In the Workspace, click Record Types > Defect > States and Actions.

6 - 2 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

13. Double-click Behaviors. ClearQuest Designer displays the Behaviors table in the
right pane.

14. In the Behaviors table, find the user_number field. In the Submitted state column,
it should be OPTIONAL.

15. Right-click the cell, and select MANDATORY. The behavior of user_number
field in the Submitted state is now MANDATORY.

16. Close the Behaviors table.

TASK 3 – Add the new field “user_number” to both the Submit form and the
Record form of Defect record type.

17.In the Workspace, click Record Types > Defect > Forms. There are two items:
Defect_Base_Submit and Defect_Base.

18.Double-click the Defect_Base_Submit form. Beside the form layout, three items
appear: Form Tool Bar, Control Palette, and Field List.

19.In the form layout, stretch the display so that there is enough room to add a field to
the Main tab. You may need to maximize the Designer window in order to see the
entire form layout. Position the pointer on a bottom corner or the lower edge of the
form, and drag the form outward to enlarge the display.

20.Find user_number in the Fields List for ‘Defect window. Drag and drop the field
onto the form under the control for the Description field.

21.Adjust the positions of the name of the field and the text box control of the field to
have a better fit to the form layout.

22.Right-click the text box control, and select Properties.

23.In the Text Box Property Sheet dialog box, on the General tab, change the value
of the Label field to User Number. Click OK.

24.Close the form layout to commit the changes.

25.Apply the same field control to the Defect_Base form. Repeat Steps 17-24 on the
Defect_Base form.

TASK 4 – Test the new field functions in the test database.

26. Click File > Validate. The Validation Output windows indicate that “Validating
Schema…. 0 error(s) found. Validating Forms…. 0 warning(s) found.”

27. Click Database > Set Test Database.

28. In the Test Database dialog box:

© Copyright IBM Corp. 2003 6 - 3


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

a. Select Test as the Test Database.

b. Select admin as the User Name.

c. Leave the Password field blank.

d. Click OK.

29. Click File > Test Work.

The ClearQuest client interface automatically appears with the user “admin” logged on.

30. Click the New Defect button on the toolbar.

31. On the Defect Submit form, fill in the proper values for all the mandatory fields
except the User Number field. Click OK to submit.

32. A warning message tells you that the field user_number is mandatory.

33. Enter an integer value in the User Number field. Click OK to submit. The defect
submission now passes.

34. Click Query > Recently Submitted.

35. Select Defect in the Choose Record Type dialog box, and click OK.

36. ClearQuest displays the new defect just submitted. Inspect the User Number field
on the Main tab. It should have the right value.

37. Close the ClearQuest client.

TASK 5 – Check in the modified schema version.

38. In ClearQuest Designer, click File > Check In.

39. In the Check In dialog box, click OK.

40. The ClearQuest Designer dialog box shows: “Schema ‘my_schema’ has been
checked in successfully.” Click OK.

TASK 6 – Upgrade the user database “my_db” with the new schema version.

41. Click Database > Upgrade Database.

6 - 4 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

42. The ClearQuest Designer dialog box shows: “This action cannot be reversed. Be
sure you have backed up the schema repository and the user database. Continue?”
Click Yes.

43. In the “Upgrade Database – Step 1 of 2” dialog box, highlight “my_db,


my_schema, Version 3” in the list. Click Next.

44. The “Upgrade Database – Step 2 of 2” dialog box indicates that one new version
is available for upgrading the database: 4. Select version 4 by highlighting it.

45. Click Finish.

46. The ClearQuest Designer dialog box shows: “Database has been upgraded
successfully.” Click OK.

47. Close the ClearQuest Designer dialog box. This concludes Exercise 6.1.

© Copyright IBM Corp. 2003 6 - 5


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

Exercise 6.2: Add a parent/child control to the forms for linking records of the Defect
record type.

The purpose of this exercise is to create the parent/child control on both the Submit
form and the Record form to link records.

In order to link records of Defect record type, follow these steps:

1. Create a new field that:

 Is named Child_Defect.

 Is of the Reference_List data type.

 References to the Defect record type.

 Back references to Parent_Defect.

2. Add the Child_Defect field and the Parent_Defect field to both the Submit form
and the Record form for the Defect record type.

a. Create a new tab form called Links in the Submit form.

b. Add the Child_Defect field and the Parent_Defect field to the Links tab
form.

c. Customize the list view control of the Child_Defect to display the id,
Headline, and State of the Child_Defect.

d. Customize the list view control of the Parent_Defect to display the id and
Headline of the Parent_Defect.

e. Copy and paste the Links tab form design from the Submit form to the
Record form of Defect record type.

3. Test the new field functions in the test database.

4. Check in the modified schema version.

5. Upgrade the user database my_db with the new schema version.

6 - 6 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

Solution for Exercise 6.2

The following set of steps is one of the ways to approach the above tasks. You can use
these steps to accomplish the tasks listed in this exercise, or create your own.

TASK 1 – Create a new field named “Child_Defect” that has the Reference_List
data type. It references to the Defect record type and has the Back Reference set to
“Parent_Defect.”

1. Click Start > Programs > Rational Software > Rational ClearQuest >
ClearQuest Designer.

2. If the Rational ClearQuest Schema Repository dialog box appears, select


2003.06.00 by highlighting it and click Next. Otherwise, skip to step 3.

3. In the ClearQuest Designer Login dialog box, type “admin” as the User Name,
and leave the Password field blank. Click OK.

4. Select my_schema in the Open Schema Wizard. (Note that the latest version is 4.)
Click Next.

5. Type “Add a new field Child_Defect and apply the parent/child control with
this field to Defect forms” in the Comment field.

6. Click Finish. The schema my_schema, version 5 appears in the Workspace.

7. In the ClearQuest Designer window, click Record Types > Defect in the
Workspace.

8. Double-click Fields. The ClearQuest Designer displays the Fields table.

9. Click Edit > Add Field.

10. In the Defect Fields dialog box:

a. On the General tab, type “Child_Defect” in the Field Name field.

b. Select REFERENCE_LIST in the Type field.

c. Select Defect in the Reference To field.

d. Type “Parent_Defect” in the Back Reference Field field.

Close the dialog box.

TASK 2a – Create a new tab form called Links in the Submit form.

11. Click Record Types > Defect > Forms in the Workspace.

12. Double-click Defect_Base_Submit. ClearQuest Designer displays the form layout


in the right pane.

© Copyright IBM Corp. 2003 6 - 7


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

13. Select Edit > Add Tab. A new tab named Dialog Tab appears on the form layout.

14. Click the Dialog Tab.

15. Right-click the blank tab form, and select Tab Properties.

16. Change the Tab Caption field to be “Links.” Click OK.

TASK 2b-2c – Add the Child_Defect field and the Parent_Defect field to the Links
tab form. Customize the list view control for Child_Defect to display the id,
Headline, and State of Child_Defect.

17. Drag and drop the Defect>Child_Defect field from the Field List window to the
Links tab.

18. Adjust the locations of the field label, the list view control, and three buttons Add,
Remove, and New to obtain a proper layout on the tab form. Enlarge the size of the
list view control to allow the display of at least three columns.

19. Right-click the list view control, and select Properties.

20. On the General tab of the List View property sheet, change the Label field to
“Child Defects.” Click OK.

21. In the list view control, the id field is the first field on the column header top bar of
the list view. Position the pointer at the dividing line between two columns in the
column header of the list view control. The pointer changes shape. Drag the
dividing line left or right to resize the spacing for each column.

22. In the Field List window, click Defect > Child_Defect.

23. Drag and drop Defect>Child_Defect>Headline from the Field List window to the
column header top bar in the list view control. Now the Headline field is the
second field on the column header top bar of the list view.

24. Drag and drop Defect>Child_Defect>State from the Field List window to the
column header top bar in the list view control. Now the State field is the third field
on the column header top bar of the list view.

TASK 2d – Customize the list view control of the Parent_Defect to display the ID
and headline of the Parent_Defect.

25. Drag and drop Defect>Parent_Defect from the Field List window to the Links tab
form.

6 - 8 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

26. Adjust the locations of the field label and the list view control. Resize the list view
control accordingly. In the list view control, the id field is the first field on the
column header top bar of the list view.

27. Drag and drop Defect>Parent_Defect>Headline from the Field List window to the
column header top bar in the list view control. Now the Headline field is the
second field on the column header top bar of the list view.

28. Right-click the list view control, and select Properties.

29. On the General tab of the List View property sheet, change the Label field to
“Parent Defect.” Click OK.

TASK 2e – Copy and paste the Links tab form design from the Submit form to the
Record form of Defect record type.

30. Click Edit > Copy Entire Dialog to Clipboard.

31. Double-click Record Types>Defect>Forms>Defect_Base in the Workspace.

32. Click Edit > Add Tab. A new tab named Dialog Tab appears on the form layout.

33. Click the Dialog Tab.

34. Right-click the blank tab form, and select Tab Properties.

35. Change the Tab Caption field to be Links. Click OK.

36. Click Edit > Paste. All of the Links tab form layout of the Defect_Base_Submit is
copied to the Defect_Base.

37. Close both forms to commit the changes.

TASK 3 – Test the new field functions in the test database.

38. Click File > Validate. The Validation Output window indicates: Validating
Schema…. 0 error(s) found. Validating Forms…. 0 warning(s) found.

39. Click Database > Set Test Database.

© Copyright IBM Corp. 2003 6 - 9


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

40. In the Test Database dialog box:

a. Select Test as the test database.

b. Select admin as the user name.

c. Leave the Password field blank.

d. Click OK.
41. Click File > Test Work. The ClearQuest client interface appears automatically
with the user “admin” logged on.
42. Click the New Defect button on the toolbar.
43. On the Defect Submit form, fill in the proper values for all the mandatory fields,
including the User Number field.
44. Click the Links tab.
45. Click Add. In the Browse Record Type Defect dialog box, click Build Query.
46. Click Next in the ClearQuest Query Wizard.
47. Select id, Headline, and State in the “Define how the query displays” dialog box.
Click Next.
48. Click Next in the “Select fields to use as query filters” dialog box. This gets all
the defect records.
49. Click Run in the “Define query filters” dialog box. Now all the defect records
appear in the Results grid.
50. Select the defect record(s), and click OK. The defect record(s) appears in the list
view of child defects.
51. Select one defect record in the list view, and click Remove. The defect record is
removed from the list.
52. Click New. The Defect Submit form appears.
53. Fill in the proper values for all the mandatory fields. Click OK to submit. The new
defect record appears in the list of child defects.
54. Click OK to submit this new defect.
55. Click Query > Recently Submitted.
56. Select Defect in the Choose Record Type dialog box, and click OK.
57. ClearQuest displays the new defect just submitted. Inspect the list of child defects
on the Links tab. It should have the same list that you submitted.
58. Double-click one of the child defect records. In its Record form, click the Links
tab. The previous defect record appears in its parent defect list view.
59. Close the ClearQuest client.

TASK 4 – Check in the modified schema version.

6 - 10 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

60. In the ClearQuest Designer, click File > Check In.

61. In the Check In dialog box, click OK.

62. The ClearQuest Designer dialog box shows: “Schema ‘my_schema’ has been
checked in successfully.” Click OK.

TASK 5 – Upgrade the user database “my_db” with the new schema version.

63. Click Database > Upgrade Database.

64. The ClearQuest Designer dialog box shows: “This action cannot be reversed. Be
sure you have backed up the schema repository and the user database. Continue?”
Click Yes.

65. In the “Upgrade Database – Step 1 of 2” dialog box, select my_db, my_schema
Version 4 in the list. Click Next.

66. The “Upgrade Database – Step 2 of 2” dialog box indicates that one new version
is available for upgrading the database: 5. Select version 5 by clicking it.

67. Click Finish.

68. The ClearQuest Designer dialog box shows: “Database has been upgraded
successfully.” Click OK.

69. Close the ClearQuest Designer. This concludes Exercise 6.2.

© Copyright IBM Corp. 2003 6 - 11


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

Exercise 6.3: Create a record type family, and run a multi-record type query.

The purpose of this exercise is to run a query that will search the results across multiple
record types.

Here are the tasks that you will perform::

1. Create a new record type family named All_Requests. This record type family has
both Defect and EnhancementRequest record types as its members.

2. Add Headline and Owner fields to the record type family All_Requests as the
common fields.

3. Test the new field functions in the test database by following these steps:

a. Create a new query, Active Requests, on the All_Requests record type


family to find all the records that are in Submitted, Assigned, or Opened
states.

b. Run the Active Requests query. Review the query result that has records
of different record types.

4. Check in the modified schema version.

5. Upgrade the user database my_db with the new schema version.

6 - 12 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

Solution for Exercise 6.3

The following set of steps is one of the ways to approach the above tasks. You can use
these steps to accomplish the tasks listed in this exercise, or create your own.

TASK 1 – Create a new record type family named “All_Requests.” This record
type family has both Defect and EnhancementRequest record types as its members.

1. Click Start > Programs > Rational Software> Rational ClearQuest > Rational
ClearQuest Designer.

2. If the Rational ClearQuest Schema Repository dialog box appears, select


2003.06.00 by highlighting it and click Next. Otherwise, skip to step 3.

3. In the ClearQuest Designer Login dialog box, type “admin” as the User Name,
and leave the Password field blank. Click OK.

4. Select my_schema in the Open Schema Wizard. (Note that the latest version is 5.)
Click Next.

5. In the Comment field, type “Add a new record type family, ‘All_Requests’.”

6. Click Finish. The schema my_schema, version 6 appears in the Workspace.

7. In the Workspace, right-click Record Types Families, and select Add.

8. The New1 record type family appears in the Workspace.

9. Rename New1 to All_Requests.

10. Click Record Types Families > All_Requests.

11. Right-click the Members folder, and select Add.

12. In the “Add/Remove Record Type Family Member” dialog box:

a. Check both Defect and EnhancementRequest in the Available Record


Types section.

b. Click Add. Both record types appear in the Record Type Family
Members section as well as in the Workspace under Record Type
Families>All_Requests>Members.

c. Click Close.

TASK 2 – Add “Headline” and “Owner” fields to the record type family
All_Requests as the common fields.

© Copyright IBM Corp. 2003 6 - 13


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

13. Double-click Fields under All_Requests. The corresponding Fields table appears in
the right pane.

14. Click Edit > Add Field.

15. On the General tab of the All_Requests Fields dialog box, on type “Headline” in
the Field Name field. Select SHORT_STRING in the Type field. Close the dialog
box to apply the changes.

16. Click Edit > Add Field.

17. On the General tab of the All_Requests Fields dialog box, on type “Owner” in
the Field Name field. Select REFERENCE in the Type field. Select users as in
the Reference To field. Close the dialog box to apply the changes.

18. Close the Fields table.

TASK 3 – Test the new field functions in the test database.

19. Click Database > Set Test Database.

20. In the Test Database dialog box:

a. Select Test as the Test Database.

b. Select admin as the User Name.

c. Leave the Password field blank.

d. Click OK.

21. Click File > Test Work.

The ClearQuest client interface automatically appears with the user “admin” logged on.

22. Click the down arrow on the right side of the New Defect button on the toolbar.
Select EnhancementRequest.

23. In the Submit form of the EnhancementRequest record type, fill in proper values
for all mandatory fields. Click OK.

24. Submit a couple of records of the EnhancementRequest record type.

6 - 14 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
SCM490 Mastering Rational ClearQuest Administration

TASK 3a – Create a new query “Active Requests” on the “All_Requests” record


type family to find all the records that are in “Submitted,” “Assigned,” or
“Opened” states.

25. Click Query > New Query.

26. Select All_Requests in the Choose Record Type dialog box. Click OK.

27. In the ClearQuest Query Wizard, click Next.

28. Double-click the following fields: id, Headline, State, and Record_type. This
selects them as the query display fields. Click Next.

29. Double-click State to add it to the filters. Click Next.

30. In the Define query filter dialog box:

a. Select “In” as the operator.

b. Click Values. Select Submitted, Assigned, and Opened in the Select


Values dialog box, and click OK.

c. Click Run.

TASK 3b – Run the “Active Requests” query. Review the query result that has
records of different record types.

31. Scroll up and down to view the result set. You should see a number of records of
the Defect record type and the records of the EnhancementRequest record type
that you submitted.

32. Select File > Save As. Type Active Requests as the query name.

33. Close the ClearQuest client.

TASK 4 – Check in the modified schema version.

34. In the ClearQuest Designer, click File > Check In.

35. In the Check In dialog box, click OK.

36. The ClearQuest Designer dialog box shows: “Schema ‘my_schema’ has been
checked in successfully.” Click OK.

TASK 5 – Upgrade the user database “my_db” with the new schema version.

37. Click Database > Upgrade Database.

38. The ClearQuest Designer dialog box shows: “This action cannot be reversed. Be

© Copyright IBM Corp. 2003 6 - 15


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Student Workbook

sure you have backed up the schema repository and the user database. Continue?”
Click Yes.

39. In the “Upgrade Database – Step 1 of 2” dialog box, select my_db, my_schema
Version 5 in the list. Click Next.

40. The “Upgrade Database – Step 2 of 2” dialog box indicates that one new version
is available for upgrading the database: 6. Select version 6 by highlighting it.

41. Click Finish.

42. The ClearQuest Designer dialog box shows: “Database has been upgraded
successfully.” Click OK.

43. Close the ClearQuest Designer dialog box. This concludes Exercise 6.3.

6 - 16 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

You might also like