Iteration #3
Training Objectives:
In this lesson (iteration), the trainee will learn how to:
- Apply his/her training to create new packages, objects, and object operations, and rules
- Create recursive relationships
- Create inline object operations
Scope:
The scope of this iteration is to cover the following use cases:
- Add an activity to a case
Provide a simple mechanism for an Attorney to add an activity to a client case. The activity must have a subject, description, due date, completion status, assigned individual, and a general comment.
- Update an activity
Provide a simple mechanism for an Attorney to update an existing activity including marking it completed.
- Post a message to a case
Provide a mechanism for both Attorney and Client to post a message to the case file. A message must have a subject, content, a auto-generated timestamp, and a record of the author.
- Post a reply to a message
Provide a simple mechanism for an Attorney and a Client to respond to a message with message. The user must be able to view all replies associated with a particular message posting.
- Upload files and documents
Provide a mechanism to upload documents associated with the case. Each document must have a name, and a record of who uploaded it and a timestamp of the upload.
Steps:
It is highly recommended that you consult with the VE/Designer online help at each of the steps below. To do so, make sure that the keyboard focus is in the area you need help on, then press F1. You can also use the help Find ( ) tab to search for a specific term or concept.
 |
 |
| Implement "Add an activity to a case" Use Case |
- Create
Activity object in the cases package with attributes: subject: String, description: Text, dueDate: Date, category: String, isComplete: Boolean, assignedTo: String and comment: Text
- Add an Aggregate relationship from
Case to Activity with a cardinality of zero-or-more
- Add an operation named
addActivity() to Case with a Void return type and one parameter: newActivity: Activity
- Create an implementation of
addActivity() that is transactional and has one activity:
activities.add( newActivity )
- Save all
- Test this use case by going back to the
cases editor, selecting Case object and pressing the Play ( ) icon.
- Press the newly added Add Acitivity button on the top, fill in the fields for the new activity, then press the Add Activity button.
- To verify that the new activity is added properly, click on the Activities hyperlink.
|
 |
 |
 Add Activity, List Activities |
| Implement "Update an activity" Use Case |
- Add
edit() operation to Activity with Void return type and no parameters
- Implement
edit() operation with one transactional activity:
Dialog.readln( this )
- Rerun the test steps above to create a new activity then editing it
|
 |
| Implement "Upload files and documents to a case" Use Case |
- Create
Document object in the cases package with attributes: name: String, description: Text, timestamp: Timestamp, owner: String, and content: Bytes
- Add an Aggregate relationship from
Case to Document with a cardinality of zero-or-more
- Add an operation named
uploadDocument() to Case with a Void return type and one parameter: document: Document
- Create an implementation of
uploadDocument() that is transactional and has one activity:
activities.documents( document )
- Save all
- Test this use case by going back to the
cases editor, selecting Case object and pressing the Play ( ) icon.
- Press the newly added Upload Document button on the top, fill in the fields for the new document, then press the Upload Document button.
- To verify that the new document is added properly, click on the Documents hyperlink.
|
 |
 |
| Case w/Upload Document, Upload Document, List Documents |
| Implement "Post a message to a case" and "Post a reply to a message" Use Cases |
We'll follow a slightly different path for implementing these two use cases, which is to create a reusable package that captures discussion board functionality, then use it in the cases package. This same approach could have been used for both document/file management, and activity management above.
- Create a new package named
discussion
- Create a new object named
DiscussionBoard with attributes: name: String, and description: Text
- Create a
DBPosting object with attributes: subject: String, content: Text, timestamp: Timestamp, and author: String
- Set
subject format to (50)
- Add an Aggregate relationship from
DiscussionBoard to DBPosting with cardinality of zero-or-more
- Rename the above relationship to
postings
- Add a recursive Aggregate relationship to
DBPosting with cardinality of zero-or-more:
- Follow the same steps of creating a regular relationship with the exception of both the origin and destination of the relationship should be the
DBPosting rectangle
- Rename the relationship to
replies and add an inverse relationship named posting. Warning: There is a bug in the Object Modeler of the current build that prevents you from making these changes. Accordingly, follow the following steps using the Object Editor instead to accomplish the step's objective:
- Double-click on the recursive relationship
- Rename it to
replies
- Add a new relationship named
posting
- Change the To field to
discussion/DBPosing
- Type replies in the Inverse field
- Select the
replies relationship row
- Type posting in the Inverse field
- Return to the
discussion package editor and your changes will be reflected in the mode
- Add
post() operation to DiscussionBoard with Void return type and one parameter: newPost: DBPosting
- Add
reply() operation to DBPosting with Void return type and one parameter: newReply: DBPosting
- Implement
post() with a transactional process with one activity:
postings.add( newPosting )
- Implement
reply() with a process as follows:
if( posting == null ) transactional { replies.add( newReply ) } else posting.reply( newReply ) See the activity diagram for reply() to convert the above into a diagram (right-click on the Decision and select Add Condition to add the else condition).
- Save All
- Test the discussion board functionality by selecting
DiscussionBoard and pressing the Play ( ) icon.
|
 |
 |
 Run 2 Run 3 Run 4 Run 5 Run 6 |
To complete these two use cases, we need to integrate the discussioncases package:
- Open the
cases package editor and select the General tab. If the discussion package doesn't show up under the available packages. Close the cases package and reopen it.
- Select the
discussion package from the list of available packages and move it to the Selected side to make it a required package
- Select the Case Model canvas tab
- Import
discussion/DiscussionBoard
- Move it to an empty area on the canvas
- Create an Aggregate relationship from
Case to DiscussionBoard with cardinality of one
- Add
postMessage() operation to Case with Void return type and one parameter: message: DBPosting
- In the
Case Object Editor, select the postMessage() operation, then click on the Rules tab
- In the Inline field enter the formula:
discussionBoard.post( message )
- Save all and you're ready to test
|
 |
 |
| Run Attorney Portal |
None of the use cases above require any modifications to the attorney portal. However, before you test the new functionality, make sure you use the admin portal to define one or more attorneys, then attorney portal to add some clients, and client cases.
Once you have some data entered, use the Search Cases tab to locate and expand a case where you can try these new cases on.
|
 |
| Add Activity, List Activities |
| Upload Document, List Documents |
| Post a Message, List Messages, Post a Reply |
Outstanding Functionality:
The only outstanding functionality are to auto-populate Document.owner, and DBPosting.author and make them read-only for external. This logic will be added at a later iteration once the security functionality is integrated.
Recap:
In this lesson (iteration), the trainee learned:
- Applying his/her training to create
discussion package
Activity, Document, DiscussionBoard, and DBPosting objects
Case.activities, Case.documents, Case.disussionBoard, and DiscussionBoard.postings relationships
- Creating
DBPosting.replies recursive relationship that is also bi-directional
- Creating
Case.postMessage() inline operation
|