Exploring rules perspective 
The gadget spec URL could not be found

In Part I, we created an application using an existing template "Learning Guide App" and deployed it on Google App Engine. The application provided a simple screen interface to maintain and list customer details. In this section, we will explore the rules perspective.

Log into OrangeScape Trial Studio and launch the application that we created.

The folders containing the data models will be displayed. Click on a folder to open and view the data models in that folder. 

Click on "Orders Menu" folder to open it.
CustomerOrders and ProductOrders data models in the "Orders Menu" folder is displayed. 

Open the CustomerOrders data model by clicking on the Open button.


Once the model is opened, you will be able to navigate to other perspectives. Click on the rules tab to open the rules perspective.
What's the next step?
  Reviewing customer data model and its implementation

Label cells and Public cells

The current model name "Customer" is displayed at the top of the page.
The cells in rows 1 and 3 are referred to as Label cells and contains simple text. These cells are used only for improving readability of the data fields.
The cells in rows 2 and 4 are the data fields in the customer data model and are referred to as Public cells.
 How to create public cells?
"Name Manager", "Define Name" or "Create from Selection" option can be used to create public cells. Click here to learn more.

Format - Define the data type for a public cell

The default format applied to a newly created public cell is "Number". The format can be updated using the "Format" icon in the "Cells" option.

How to define format for a cell?
Select the cell for which the format is to be defined. Click on the "Format" icon.
"Number Format Wizard" will be displayed. Select the required format and click on the "OK" button to confirm.

Format Types:
  • General
  • Number
  • Currency
  • Accounting
  • Date
  • Time
  • Text
  • Boolean

Name box, Formula bar, Instance tabs

The public cell name is displayed in the Namebox and its corresponding value/formula is displayed in the Formula bar.
Instance tabs: By default, it shows the current instance of the data model. New instances can be added by clicking on the "Create Instance" icon next to the tabs. You can open an instance by clicking on the corresponding instance tab.
What is an Instance?

What is a SheetID?

Click here to learn more.

Formula cells, Functions

Concatenate function has been used to join the string values in "FirstName" and "LastName" public cells and store it in "FullName" public cell.

Insert function "fx" in the formula bar can be used to list the available functions and select the required one.

What functions are available?

How do we use those functions?
 Click here to learn more.
Static list

Static list has been used to provide a list box for "Sex" parameter.

If a public cell can take only a set of definite values, "Static List" option can be used to provide a list box.

How do I create a Static List?

How do I provide a list box for a public cell using static list?

 Click here to learn more.

Business rules

Age must be calculated based on customer's date of birth. A combination of functions and/or formulae can be used to achieve the same.
Date function "YEARFRAC" and Math function "ROUNDDOWN" is used to calculate the age.

YEARFRAC returns the difference between two dates in years (e.g. 1.5, 5, 28.25 etc).

ROUNDDOWN rounds the number down to the nearest integer, towards zero. (e.g. 28.6 will be changed to 28).

  Summary - What did we learn?

  • Label cells contain simple texts to improve the readability of the data fields.
  • Public cells are the data fields in the data model.
  • Business rules are written in the data model using functions and/or formulae.
  • Static lists can be used when the set of values that a parameter can accept is definite.