Previous Next JavaScript must be enabled to correctly display this content

## 19.5.4 Editing an Existing Automation

Edit an existing automation on the Automation page.

To edit an automation:

1. Navigate to the Automations page:
   1. On the Workspace home page, click App Builder.
   2. Select the application.
   3. On the Application home page, click Shared Components.
      The Shared Components page appears.
   4. Under Workflows and Automations, select Automations.
2. On the Automations page, click the automation Name.
   The Automation: Name edit page appears. Edit the appropriate attributes.
3. Name:
   1. Name - Defines the name of the automation.
   2. Static ID - Defines the Static ID for this automation. Use the Static ID when manually executing the automation with the `APEX_AUTOMATION` package (for example, `APEX_AUTOMATION.EXECUTE`).
4. Settings:
   1. Type - Scheduled executes automatically based on the selected frequency. On Demand executes when called explicitly using the `APEX_AUTOMATION` package.
   2. Schedule Expression - Use Database Scheduler calendaring syntax to define repeating execution schedules, such as "every Tuesday and Friday at 4:00 p.m." or "the second Wednesday of every month".

      The calendaring syntax can either be entered manually, or declaratively to build simple expressions by using the Interval Builder. Access Interval Builder by clicking the Schedule Builder icon to the right of the text area.

      `BACKGROUND_MIN_EXECUTION_CADENCE` controls the minimum amount of minutes which must be between two subsequent automation executions. Note that the automation scheduler works in the time zone of the database server.

   3. Schedule Status - Indicates the state of the Automation Schedule. Options include:

      - Active - Schedule is active and the automation will be executed based on the Schedule Expression.

      - Disabled - Schedule will not be executed. However, the automation can still be executed by calling the `APEX_AUTOMATION` package.

      - Error - Schedule is disabled because an error occurred during the last execution. However, the automation can still be executed by calling the `APEX_AUTOMATION` package.

   4. Actions Initiated On - Specify the data source type for this automation. Options include:

      - Query - A SQL Query will be executed. Automation actions can be executed when data is found (for each row), or when no data is found (once).

      - Function Body Returning Boolean - A PL/SQL function body is executed. If it returns TRUE, then the automation actions are executed once.

      - Always - Automation actions are always executed. This option is suitable to be used with the Schedule type to execute the actions based on a schedule regardless of the presence of certain data.

5. Source:

   - Data Source - Defines the Data Source for this automation. Options include:

     - Local Database - Data is sourced from the local database.

     - REST Enabled SQL Service - Data is sourced from a remote database, where the connection is defined using REST Enabled SQL. To create or maintain REST Enabled SQL references, navigate to Shared Components, REST Enabled SQL.

     - REST Data Source - Data is sourced from a RESTful web service defined using REST Data Sources. To create or maintain REST Data Sources, navigate to Shared Components, REST Data Sources.

     The option you select determines the subsequent UI options. To learn more about an attribute, see item Help.

6. Actions:
   1. Add an Action - Click Add Action.

      The Edit Action page appears. Edit the attributes and click Create.

   2. Edit an action - Click the Edit icon adjacent to the action Name.

      The Edit Action page appears. Edit the attributes and click Apply Changes.

   To learn more about an attribute on the Edit Action page, see item Help.

7. Action Execution:
   1. Execute Actions When - Specify whether the automation actions should execute when the query returns rows or when the query does not return rows.
   2. Primary Key Column - Optionally, specify the primary key column within the query result. The value of this column will be added to the log messages, in order to allow correlating log messages to source rows.
   3. Commit - Specify whether to commit after the actions for each row have been executed or to commit just once after all rows have been processed.
   4. Maximum Rows to Process - If defined, the automation execution stops when that maximum is reached and the automation is logged as `Incomplete`.
   5. Action Error Handling - Select what should happen when the automation encounters and error:

      - Ignore - Ignore error and continue processing automation

      - Terminate Automation - Terminate automation but leave it enabled

      - Disable Automation - Terminate automation and disable it

8. Additional Code Execution:
   1. Executable PL/SQL Code - Enter a PL/SQL anonymous block of code that contains procedures to be called for the initialization or cleanup of the automation, or before action processing for each row. For performance reasons, you can also store this code in a PL/SQL package in the database.
   2. Initialization Procedure Name - Provide the name of an Initialization Procedure to execute at the very beginning of an automation execution. Define the procedure as a PL/SQL object in the database schema, or above in Executable PL/SQL Code.
   3. Before Row Processing Procedure Name - Provide the name of a Before Row Processing Procedure to execute for each row, before executing the defined actions. Define the procedure as a PL/SQL object in the database schema, or above in Executable PL/SQL Code.
   4. Cleanup Procedure Name - Provide the name of a Cleanup Procedure to execute at the very end of the automation execution. Define the procedure as a PL/SQL object in the database schema, or above in Executable PL/SQL Code.
9. Server-Side Condition:
   1. Condition Type - Select a condition type from the list that must be met in order for this automation to be executed.
      The UI changes depending on the Condition Type you select. If you select Expression, the Language and Expression 1 attributes display.
   2. Language - Select a language that is used to evaluate the entered programming code.
   3. Expression 1 - Enter an expression to conditionally control the circumstances under which this automation will be executed. Enter values in this attribute based on the specific condition type selected. The automation will execute only if the specified condition is met.
10. Advanced:
    1. Build Option - Select a build option for this automation. Build options are predefined settings that determine whether or not components within an application are enabled.
    2. Comments - Enter any developer comments or notes here. These comments only display within App Builder and never display when running the application.
11. To save your edits, click Save Changes.
12. To execute the automation. click Save and Run.
13. To delete the automation, click Delete.

See Also:

- APEX_AUTOMATION package in Oracle APEX API Reference
- Configuring Background Jobs in Oracle APEX Administration Guide
- DBMS_SCHEDULER Operational Notes in Oracle AI Database PL/SQL Packages and Types Reference

Parent topic: Managing Automations