Skip to main content

Command Palette

Search for a command to run...

Re-enable specific automations after app update in Oracle APEX

Published
1 min read
Re-enable specific automations after app update in Oracle APEX
V
Oracle APEX Certified Developer, passionate about the Oracle Database ecosystem. A dedicated Oracle APEX evangelist with experience in enterprise solutions, API integrations, performance tuning, and data modeling. On my blog, I share practical, real-world solutions I use daily — always focused on simplicity and efficiency.

One thing that can be a bit annoying is that APEX automatically disables all automations whenever an application is overwritten with a new version.

I usually automate much of the pipeline for generating and deploying database objects and applications to other servers, and I noticed that, by default, automations are always disabled after an app update.

To work around this, I created the script below, which I run after each successful app update. You can customize it to your needs by specifying the automations you want to re-enable. You can also modify the script in any way that suits your workflow.

SET SERVEROUTPUT ON

BEGIN
    apex_util.set_workspace('YOUR_WORKSPACE_NAME');

    apex_session.create_session(
        p_app_id   => 117,     --App ID 
        p_page_id  => 1,       --Any Page in the App
        p_username => 'VALTER'  );  -- Any valid APEX User

    --Enable specific automation
    apex_automation.enable(
        p_application_id  => 117, --App Id
        p_static_id       => 'emitir-espelho-retorno-nf' ); -- Static id

     --Destroying the session
    apex_session.delete_session;
END;
/

You can also create a simple loop to enable all your automations, or implement any custom logic based on the results from this view:

SELECT * FROM APEX_APPL_AUTOMATION

References:

https://docs.oracle.com/en/database/oracle/apex/24.1/aeapi/APEX_AUTOMATION_ENABLE-Procedure.html