< Previous | Next >

Replace a role

The goal of this exercise is to extend base method content associated with a role using Replaces variability.

  1. Switch back to the Authoring perspective.
  2. Create a new content package in my_plug-in. Name the new content package "replace_test". Save your changes by closing the editor panel.
  3. Create a new role in the content package that we just created.
  4. Use these attributes for the new role:
    • Name: my_replace_tester
    • Presentation name: My Replace Tester
    • Brief description: My replaced brief description
    • Main description: My replaced main description
  5. Use the Variability type menu to select Replaces then click Select in this section. The Select Dialog: Roles window opens.
  6. Select tester to be the base role. Click OK to save changes and close the selection window.
  7. Save your changes by closing the role editor panel.
  8. Update my.basic.configuration by doing the following:
    1. Double-click the my.basic.configuration icon in the Library view panel. The configuration editor opens.
    2. In the Plug-in and Package Selection tab expand my_plug-in > Method Content > Content Packages.
    3. If they are checked, clear contribution_test and extends_test.
    4. Check replace_test. This should be the only content package selected in my_plug-in. This is done so that there are no conflicting extensions in the same method element.
    5. Close the configuration editor panel to save your changes.
  9. Now switch to the Browsing perspective.
  10. Expand Role Sets > Basic Roles.

    In the Configuration view you will see that there is no tester role in the Basic Roles folder. It was replaced by the My Replace Tester role.

    Also notice that other content elements in the base plug-in that referenced the tester role now reference the replacing role instead. If you open the Disciplines folder and view the task Implement Test, you will see that the Primary Performer is now My Replace Tester. Replace works in a similar way for tasks, artifacts, guidance and categories.

< Previous | Next >