Rational Developer for System z

Adding a rule to an existing rule plug-in project

This topic describes how to add a user-written custom rule to an existing custom-rule project.

After you have generated a plug-in project for a user-written custom rule, you can add other user-written custom rules to the same project. If the plug-in has already been installed into the Developer for System z® environment, then you will need to update the feature, the update site, and the Developer for System z environment to install the new rule. See Installing a user-written custom rule plug-in.

To add a user-written rule to an existing plug-in project:
  1. Open the Plug-in Development perspective if it is not already open.
  2. In the Package Explorer view, expand the user-written custom rule plug-in project to which you want to add a new rule.
  3. Right-click plugin.xml and click Open With > Plug-in Manifest Editor.
  4. In the editor, click the Extensions tab.
  5. Click Add. The New Extension wizard opens.
  6. On the first page of the wizard:
    1. Click the Extension Wizards tab.
    2. In the left pane click Code Review Templates and then in the right pane click Custom COBOL Code Review Rule.
    3. Click Next.
  7. On the second page of the wizard:
    1. In the Rule class field enter a rule class name for the new rule.
      Note: Depending on your plug-in, you probably want the new rule class name to indicate how the new class is related to existing classes in the plug-in. For example, rule classes for the Data division might be named datadivision.rule0001, datadivision.rule0002, and so on.
    2. In the Rule label field enter a label for the new rule.
    3. You can create a new rule category for the new rule or you can add the new rule to an existing built-in or custom rule category.
      • To place the new rule into a new rule category, click Create a new category and enter a category ID and category name for the new category.
      • To add the rule to an existing category, click Select an existing category, then expand the list and select the category to which you want to add the new rule.
    4. Expand the Program tree and select the COBOL language element or elements that the implementation code for the new rule needs to check for violations. The default is no elements selected.
    5. Click Finish.
    A source code file is generated for the new class, and the plugin.xml is updated with an extension for the new rule. See Generating a plug-in project for a user-written custom rule.
  8. In the plug-in manifest editor, save the new state of the plug-in.


Feedback