Getting Started in Code Search

Code Search is project related. It executes a search over all verified files in the project.

This section describes a sample use of Code Search that should help you get oriented in the tool. Assume that you want to create business rules for segments of code that write to a file:

  1. In the Interactive Analysis window, if the Code Search pane is not visible, click View > Code Search. This displays the Code Search pane in the Interactive Analysis window.
  2. In the Code Search pane, click the Top view link. The Top view opens.
  3. Double-click the Rule Finder category. The Rule Finder view opens.
  4. On the tool bar, click Add (New List Button). This opens the New list dialog box.
  5. In the Enter new list name field, type File Writes and then click OK. An empty list named File Writes is added to the Rule Finder view.
  6. Click Advanced Search. This opens the Search dialog box.
  7. In the top left, select the file type you want to execute the search against. In this case COBOL File.
  8. In the Search In list, select All Objects.
  9. In the Criteria tree, expand the Data Ports folder, then expand the Files folder. Select the predefined All File Writes criterion and then click Find All Constructs.
    Note: You can modify the predefined search criterion or create your own search criterion as you do in the Advanced Search facility.
  10. Interactive Analysis displays a list of files that match the search criteria in the Code Search pane. The count column displays the number of constructs found in the file.
  11. Click Execute (Run Button) and then click Create Rules from the displayed list. This opens the Rules dialog box. Which displays the following message:
    You are about to generate templated business rules into a specified rule set. Continue?
  12. Click Yes to continue. This opens the Create Rules From List dialog box.
  13. Select an existing Business Function from the list or create a new one by clicking New:
    1. If you choose New, the Business Function dialog box opens.
    2. In the Business Area field, select a business area from the list or type a new one.
    3. In the Name field, type a name.
    4. (Optional) In the Technical Description field, type a technical description of the function.
    5. (Optional) In the Business Description field, type a business description of the function.
    6. Click OK to create the business function and to return to the Create Rules From List dialog box.
    The newly created Business Function is selected.
  14. Select an existing Rule Set from the list or create a new one by clicking New:
    1. If you choose New, the Create Rule Set dialog box opens.
    2. The Name field has an auto-generate name, if you want you can type your own name.
    3. (Optional) In the Technical Description field, type a technical description of the function.
    4. (Optional) In the Business Description field, type a business description of the function.
    5. Click OK to create the rule set and to return to the Create Rules From List dialog box.
  15. (Optional) Click the Business Description Template tab, and then type a description.
  16. (Optional) Click the Technical Description Template tab, and then type a description.
  17. Click OK.

    This creates the rule.

  18. To view the new rule, click View > Rules This opens the Rules pane which contains the new rule created. In the Grouping tab you can see a tree displaying all the instances that match the rule created.