15.4 Understanding Application Processes
Create an application process to run a block of PL/SQL logic at a specific point 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.
Tip:
To learn more about execution behavior in the case of a validation error, see What Happens When a Validation Fails?- On Demand Application Processes
On Demand processes are useful when you have PL/SQL logic that you would like to run from different execution points across multiple pages. - About Application Processes that Execute On New Instance
Processes with a Process Point of On New Instance enable you to retrieve information once within a user's session. - About Running an On Demand Process from a Page Request
Run an On Demand process from a page request. - Example: Application Process
View an application process example. - Creating an Application Process
Create an application process from Shared Components. - Editing Application Process Attributes
Edit application process attributes from Shared Components. - Copying or Subscribing to Application Processes
Copy application processes from the current application or from another application. When copying an application process from another app, you can also subscribe to it. - Subscribing to an Application Process
Subscribe to an application process on the Application Processes, Edit page. - Creating Application Process Error Messages
Learn how to define application process error message. - Viewing the Application Processes History Report
To view the Application Process History report.
See Also:
Understanding Page ProcessesParent topic: Managing Computations, Validations, and Processes
15.4.1 On Demand Application Processes
On Demand processes are useful when you have PL/SQL logic that you would like to run from different execution points across multiple pages.
An On Demand process is special type of application process which has a Process Point of On Demand, is of type PL/SQL, and executes when called from a page-level On Demand process or from an Ajax call from the browser.
On Demand processes should typically be created on a page and not at the application-level. On Demand processes created at the application-level are created with an initial authorization scheme of Must Not Be Public User to prohibit the processes from being invoked from users in unauthenticated sessions.
See Also:
Parent topic: Understanding Application Processes
15.4.2 About Application Processes that Execute On New Instance
Processes with a Process Point of On New Instance enable you to retrieve information once within a user's session.
Typically an application process runs at the same point across multiple pages in an application. Processes having a Process Point of On New Instance are the exception. These types of processes are useful when you only need to retrieve information once within a user's session. For example, if the application items do not depend on the logged in user, you can initialize them using the Process Point On New Instance. To look up information that depends on the user, you can also use After Authentication.
If you configure applications to share the same session by setting the same cookie name in the authentication scheme, On New Instance and After Login, the application processes fire whenever Oracle APEX first processes a request for the application (that is, On New Instance), or processes a request of an authenticated user for the application (that is, After Authentication).
Parent topic: Understanding Application Processes
15.4.3 About Running an On Demand Process from a Page Request
Run an On Demand process from a page request.
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 aliaspage_id
is the page number or alphanumeric aliassession
is the session IDAPPLICATION_PROCESS=process_id
is the keywordAPPLICATION_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 APEX engine recognizes the request and processes it using the following rules:
- The page number in the URL can be the current 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. Note that if you are logged in to App Builder as a developer, an error messages displays.
- Specifying the process by name locates the first process with the specified (case-preserved) name.
See Also:
Parent topic: Understanding Application Processes
15.4.4 Example: Application Process
View an application process example.
A shopping cart application is a good example of when you might use an application
process. For example, to display the contents of a user's shopping cart with each
page view, 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 APEX 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
.
Parent topic: Understanding Application Processes
15.4.5 Creating an Application Process
Create an application process from Shared Components.
To create an application process:
Parent topic: Understanding Application Processes
15.4.6 Editing Application Process Attributes
Edit application process attributes from Shared Components.
To edit an existing page process:
Parent topic: Understanding Application Processes
15.4.7 Copying or Subscribing to Application Processes
Copy application processes from the current application or from another application. When copying an application process from another app, you can also subscribe to it.
Tip:
Subscriptions enable developers to reuse shared components across several applications in a workspace. To learn more about subscriptions, see Using Shared Component Subscriptions.Note:
When copying an application process from another app, shared component dependencies are automatically resolved. To learn more, see About Automatic Dependency Resolution.To copy or subscribe to an application process:
- Navigate to the Application Processes page.
- To copy an application process within the current application:
- To copy an application process from another application:
Parent topic: Understanding Application Processes
15.4.8 Subscribing to an Application Process
Subscribe to an application process on the Application Processes, Edit page.
Subscriptions enable developers to reuse shared components across several applications in a workspace. To learn more about shared component subscriptions, see Using Shared Component Subscriptions.
Tip:
You can also subscribe to a search configuration by copying it and then subscribing. See Copying or Subscribing to Application Processes.To subscribe to an application process:
Parent topic: Understanding Application Processes
15.4.9 Creating Application Process Error Messages
Learn how to define application process error message.
If a process raises an error, you can define an error messages that displays to the user. How the error message displays depends upon the processing point. For processes with a processing point of On Submit - Before Computation and Validations
or On Submit - After Computations and Validations
, you can specify whether the error message displays inline on the current page (the default) or on a separate page. For all other application processes, error messages display on a separate error page.
To create an application process error message:
See Also:
Parent topic: Understanding Application Processes
15.4.10 Viewing the Application Processes History Report
To view the Application Process History report.
To view
See Also:
Parent topic: Understanding Application Processes