Iteration #4
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:
- View Cases
Provide a simple mechanism for a Client to view a list of their cases.
In addition, expose the following use cases that already developed in previous iteration to Client actor:
- 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.
Personalization Background
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 "View cases" Use Case |
Before we create a process for listing the current client cases, we need to know the current client. We'll follow similar steps to what we used to figure out the current attorney with one little veriation so we can cover different ways to accomplish similar functionality. More specifically,
- Create a transient root object
CurrentClient with target Client and a cardinality of one.
- Instead of adding
getCurrent global (static) operation to Client, we will add a global stand alone process (package level) named getCurrentClient. This process has very similar steps to the Attorney.getCurrent() operation:
- Add a Decision (
) step to the process with a condition
CurentClient.>id == null to check whether the CurrentClient is initialized or not.
- Add activity right below the decision (make sure that the mouse is very close to the decision node so the activity is inserted under this condition not after it), and enter the formula
CurrentClient = Dialog.select( TheLawFirm.clients )
- For the process return, enter formula:
TheLawFirm.clients[ id == CurrentClient.id ]
- You can test this process by pressing the Play (
) on the VE/Designer toolbar. But first, make sure that you have some client populated by executing the admin portal and using the Clients tab. While you at it, also add few attorneys, as we'll need to add few cases in the following step, which requires a current attorney.
- Once you select the current client by executing
getCurrentClient(), and have already added one or more attorneys, go ahead and press the Add Case button in the browser, and add one or more client cases.
Now, we're ready to add a process for list current client cases:
- Create a stand-alone (package level) process named
listCurrentClientCases with a return type of Bag of Case
- Add the return formula:
getCurrentClient().cases
- Save the process and test.
|
 |
 |
 |
| Run |
| Create Client portal |
Let us create a portal for the Client actor:
- Create a new portal named
client
- Add the following navigations:
- A place holder navigation for future use (will be used as a client portal page)
- Navigation for List Cases
- Title: Cases
- Name:
listCases
- Action: Execute
- Resource:
cases/listCurrentClientCases
- Save and test the newly created portal
|
 |
| Personalize Cases |
When you run the client portal, click on the Cases tab so we can start personalizing it. What we're about to personalize is really a Bag of Case as a top (not embedded) level object. If you remember, the Cases tab (navigation) launches the listCurrentClientCases() which returns a Bag of Case.
To personalize:
- In the browser showing the cases tab activated, press the F12 key, which will switch the page to WYSIWYG editor.
- Move the mouse around the different parts of the page, and you will notice a yellow rectangle will appear around areas that you can edit
- Select the Cases table by clicking once on it while the yellow rectangle is surrounding it. This will put a red rectangle around it and open the content property window in the bottom of the browser
- Now, we would like to limit the attributes of
Case (columns) that are showing in the table. To do so,
- Click on the ... button right next to the Attributes pull-down menu in the 3rd line of the content properties, which will open the Customize Content Dialog
- Select the attributes: Id, Title, Date, Other Parties, and Attorney Name, then press OK.
- The browser page will be refreshed to reflect the changes.
- Now, we would like to make the table read-only, so the client cannot edit any of the cases attributes. To do so,
- Click on the READ/WRITE-READ ONLY toggle button right next to the CONTENT label in the third line of the content properties
- Click the refresh (
) button in the bottom-right corner of the browser window
- Notice the changes reflected in the refreshed window
- To dress up the Cases table a little, we can change the properties of the Default Array Widget associated with it:
- Click on the ... button in the WIDGET section of the content property window (the right side of the third line) to open the widget properties dialog
- Change the properties according to the shown dialog to change the table background, alternate row, and border colors, show the read-only attributes in plain text (label) instead of fields, and disable the ability to drill down (an alternate way will be used in the following step) or select a row.
- Press OK when finished to see the refreshed page.
- Finally, we would like to change the widget associated with the Title attribute (column) of the Cases table to a hyperlink that fetches the details of the case (serve back the Case object into a new web page):
- While the Cases table is selected, move the mouse on top of the first row in the Title column, then click when the yellow border around the title field is shown.
- The properties section of the browser window will reflect Element Properties for the
title attribute. The widget is set to Default String Widget
- Change the widget to Member Link Widget
- Click on the ... button next to the Member Link Widget pull-down menu. In the widget properties dialog, set Name of Relationship to Navigate on Click field to this reflecting that you would like to fetch the same object represent by the row when a user clicks on the hyperlink.
- Press OK to see the refreshed page.
- We're ready to save our changes. Press the Save (
) on the editor top tool bar, which will save your changes to the client portal and refreshes the page back to runtime mode.
|
 |
 |
 |
 |
 |
 |
| Personalize Case |
Now, let us personalize the Case object. Our goal is to personalize it for Client actor use (which would look like this), with the actions being on the right hand side right above the related links, and put the Case details in a read-only mode so the Client cannot edit them.
While keeping the browser window with the client portal open:
- Select the Cases tab
- To fetch the details on one of the cases, click on its title hyperlink
- Press F12 to go into the WYSIWYG edit mode
|
 |
|
To make the Case details as read-only, select the details area, then click on the Read/Write ( ) toggle button in the Content Properties then refresh ( ).
To create an area with hyperlinks representing Case operations:
- Select the Related Links area, then press the Split Vertical (
) button in the toolbar. This will create a new area above the Related Links and defaults to Embedded HTML.
- Select the newly added area and convert it to
Case's operations content:
- Press Content (
) button in the toolbar
- A dialog will open so you can specify which content to show, along with the aspect and widget. Make sure you select Case as the content, press Select, then specify Operations for aspect. You can leave the widget to Default Operation Widget then press Select.
- Now, we would like to make the
Case operations to be laid out vertically. Change the Default Operations Widget properties accordingly.
- Notice that the operations are shown as buttons, we need to change their style to hyperlinks. To do so,
- To limit the visible operations to the Client actor to Upload Document and Post Message (to comply with the use case model), press the ... button next to the Operations aspect pull-down menu in the Content Properties, then check these two operations.
- Finally, to add a border and a border title:
- Click on the Show/Hide (
) toggle button right next to the Title label
- Type in Actions in the Title field.
- Press the ... button next to the Border widget, then specify Border Width of 1px and Border Style of Solid as shown.
|
 |
|