HomeOracle Page 3 - Adding Computations, Processes, and Validations
Computations - Oracle
Validations, computations, and processes greatly increase the functionality of an HTML DB application. In this three-part series (of which this is the first part), you'll learn about the different types and where to use them. This article is excerpted from chapter 13 of the Oracle HTML DB Handbook, written by Lawrence Linnemeyer and Bradley Brown (McGraw-Hill, 2006; ISBN: 0072257687).
Computations are bits of logic used to populate the value of an application-level item or a page item. Computations can be defined either at the application level through the shared components of an application or on an individual page. Computations defined at the application level will be executed for every page, but as with almost everything in HTML DB, you can specify a condition that will be evaluated before the computation is executed on each page.
When creating a computation, you select the computation point and the computation type. The available computation points are as follows:
On New Instance (for example, On Login)
Select the computation point that makes the most sense for the implementation of your business logic, the relationship of the item whose value you are calculating, and the other items that you might be using in the calculation. With the exception of the After Submit computation point, all the other points occur in the rendering of the page. The After Submit computation point is used for setting the value of items based on user input received from the page but prior to the execution of the page processes.