Application processes are blocks of PL/SQL logic that are set to run at specific points using processes from multiple pages of an application. By default, application processes execute at the same point for every page in the application. However, you can apply conditions for specific pages to control when the process executes.
Topics in this section include:
A special type of application process is the On Demand process. An On Demand application process has a Process Point of On Demand and executes when called from a page-level On Demand process. On Demand processes are useful when you have PL/SQL logic that you would like to run from different execution points across multiple pages.
See Also:
"Creating a Page Process"You can have a page request run an On Demand process by using the following syntax:
f?p=application_id:page_id:session:APPLICATION_PROCESS=process_id
Where:
application_id
is the application ID or alphanumeric alias
page_id
is the page number or alphanumeric alias
session
is the session ID
APPLICATION_PROCESS=process_id
is the keyword APPLICATION_PROCESS=
followed by either the process ID or an alphanumeric name of an application-level process having a Process Point of On Demand
When you use this syntax, the Application Express engine recognizes the request and processes it using the following rules:
The page number in the URL can be any page number or alias. A page number or alias is required in the request only as a syntactic placeholder because no specific page is accessed for this type of request.
The process authorization scheme, the application's authorization scheme, and the process conditions are supported.
Session state (that is, item names and values) may be set in the URL, but clear cache options are ignored.
Any failures of authentication, authorization, or process conditions do not result in visible error messages or other indicators of such failures and most often result in a blank page being displayed.
Specifying the process by name locates the first process with the specified (case-preserved) name.
See Also:
"Clearing Session State"A shopping cart application is a good example of when you might use an application process. For example, suppose you need to display the contents of a user's shopping cart with each page view. To accomplish this, you create a region on page zero of your application that displays the values of the application-level items TOTAL_CART_ITEMS
and TOTAL_PURCHASE_PRICE
.
Instead of writing a process for each page to set the values of TOTAL_CART_ITEMS
and TOTAL_PURCHASE_PRICE
, you could write an application process of type On Load: Before Header to compute these values. Then, the Application Express engine would execute the process on each page as it renders the application. As a result, each page, would display the most current values for TOTAL_CART_ITEMS
and TOTAL_PURCHASE_PRICE
.
To create an application process:
Navigate to the Shared Components page:
On the Workspace home page, click Application Builder.
Select an application.
On the Application home page, click Shared Components.
The Shared Components page appears.
Under Logic, select Application Processes.
Click Create.
For Identification:
Name - Enter a name for the application process.
Sequence - Specify the sequence number for this process. The sequence number determines the order in which the process will be evaluated relative to other processes.
Point - Identify the point at which this process executes.
Click Next.
For Source:
Process Text - Enter the text that is to be the source of your process.
Error Message - Enter the error message that displays if the process raises an error.
Click Next.
For Conditionality:
Condition Type - Select a condition type that must be met in order for this process to execute.
Expression 1 and Expression 2 - Use these attributes to conditionally control whether the process executes. Enter values in this attribute based on the specific condition type you select. The process will execute if the specified condition is met.
Click Create Process.
Once you create an application process, it appears on the Application Processes page. You control how the page displays by making a selection from the View list. Available options include:
Icons (the default) displays each process as a large icon. To edit a process, click the appropriate icon.
Details displays each application process as a line in a report. To edit a process, click the name.
After you create an application process, you can access the Utilization and History reports.
To access application processes reports:
Navigate to the Workspace home page.
Click Application Builder.
Select an application.
On the Application home page, click Shared Components.
Under Logic, select Application Processes.
Select one of the following tabs at the top of the page:
Utilization
History
Follow the on-screen instructions.
Click Utilization to display the Application Process Utilization page. This page displays application processes used in the current application.