| Use case: | Build |
| Actors: | Expert |
| Purpose: | Create and fill a structured matcher with expert knowledge. |
| Overview: | An expert builds a structured matcher tree by building individual simple matcher and adding them to tree structure. During the building of the simple matcher, the expert creates and arranges the questions in a manner that represents his knowledge. |
| Type: | primary and real |
| Cross References: | Functions 1, 2, 7 |
| Actor Actions | System Response |
|---|---|
| 1. The Expert starts the program by invoking java SM.Main or from a short-cut. | 2. Creates a structured matcher view JFrame with a JTree with one empty simple matcher as it's root node named Untitled. |
| 3. The Expert can
a) Create and attach a new simple matcher to an existing simple matcher.. See section Create a simple matcher. b) Populate an existing simple matcher by double clicking . See section Populate a simple matcher. |
See the pertinent sections for system response. |
| 4. The Expert saves the structured matcher by selecting the File - Save menu item and filling in the File dialog with the serialized file name. | Saves the structured matcher to the disk using object serialization. |

| Actor Actions | System Response |
|---|---|
| 1. The Expert selects an existing simple matcher by clicking on a node. | 2. Acknowledges the selection by hightlighting the selected node. |
| 3. Issues command to create a new simple matcher by choosing add from either the Node menu or the context pop up menu (activated by holding down the right mouse button ). | 4. Prompts for a name for the new simple matcher by popping up a JOptionPane with a textfield. |
| 5. Enters a new simple matcher name by typing into the textfield and selecting the OK button. | 5. Creates a new simple matcher and links it to the selected simple matcher. |
| 6. Updates the visual representation by adding a new node icon to the tree. |
| Actor Actions | System Response |
|---|---|
| 1. The Expert can open up a view of the Simple Matcher which is a JFrame
with a JTable, by double clicking on a tree node in the structured matcher
view. Then within the simple matcher view frame, the expert can
a) Add a column (question) to the simple matcher. See section Add a question to a simple matcher. b) Add a row to the simple matcher. See section Add a row to a simple matcher. c) Edit any cell in the simple matcher. See section Edit a cell in a simple matcher. |
See the pertinent sections for system response. |
| Actor Actions | System Response |
|---|---|
| 1. The Expert issues the command to add a new question to the simple matcher by selecting the Column - Add Question. | 2. Prompts the expert to select an existing question (if any) or to create a new one by entering the title, body and type of the question. This is accomplished with a custom dialog which includes a list of all previously defined question. |
| 3. Selects an existing question by clicking on the questions JList or enters the prompted information in Ref JTextfield and Body JTextfield. | 4. Saves the new question if one was added by adding it to the Questions Hashtable and links the question to the simple matcher by putting a reference to the question into the column header. |
| 5. Updates the visual representation of the simple matcher. The JTable gets a new column with the name of the question in it's header. The rows of that column shows the Don't Care condition which represents the data in the column Vector. |

| Actor Actions | System Response |
|---|---|
| 1. The Expert issues the command to add a new row to the simple matcher by selecting the Row - add row menu item. | 2. Inserts a new row into the simple matcher by adding a Don't Caret to the end of each column Vector except the last which a Likelihood.Neutral is inserted. |
| 3. Updates the visual representation of the simple matcher by adding a new row to the JTable with Don't Care in it's cells according to the number and type of existing columns. |
| Actor Actions | System Response |
|---|---|
| 1. The Expert selects a cell for editing by double clicking on it. | 2. Depending on the type of information that cell contains, present the data editor dialog appropriate to the cell's PluggableDataType. |
| 3. Edits the value(s) in the cell with the DataEditor and indicate done editing by clicking on the OK button. | 4. Updates the contents of the Column Vector with the matching condition returned from the DataEditor and the visual representation of the cell with the data's toString() return value. |