Using the Script Engine
Liferay provides a robust script engine for executing Groovy scripts. You can execute scripts to perform maintenance tasks involving data cleanup, user maintenance operations, bulk Liferay API invocations, or even system level operations.
In self-hosted or PaaS instances, you can also leverage scripts in multiple applications:
Enabling Scripting
Beginning in DXP 2024.Q3, scripting is disabled by default in workflow and objects (validations and actions). Administrators won’t even see the option for creating or executing scripts in these applications unless permission is granted explicitly by a system-level administrator.
To enable scripting for administrative users of workflow and objects,
-
Open the Global Menu () and navigate to Control Panel → System Settings (in the Configuration section).
-
From the Security category click Script Management.
-
Check the box to enable scripting.
-
Click Save.
Once enabled, the option appears for administrative applications that can leverage scripting:
Navigating to the Script Engine
The Script Console is available in the Control Panel. To use it, follow these steps:
-
Log in as an administrator.
-
Open the Product Menu and navigate to the Control Panel and select Configuration → Server Administration → Script.