Understanding Action Types

Liferay 7.4 U60+/GA60+

Actions define custom operations triggered by object entry events. Liferay provides these action types:

TypeDescription
NotificationSend email or user notifications using a predefined template.
Add an Object EntryCreate entries in an active object.
Update an Object EntryUpdate fields in the current object entry.
WebhookDeliver a payload to a URL.
Groovy ScriptExecute Groovy scripts.
Important
  • Groovy script actions are only available for Liferay PaaS and Liferay DXP Self-Hosted.
  • As of DXP 2024.Q2/Portal 7.4 GA120, scripting is disabled by default. You can enable it in System Settings → Script Management (under the Security category).

Notification

Use a notification action to send user or email notifications for object entries. Example use cases include

  • Automatically sending email notifications for new orders
  • Automatically sending user notifications for ticket updates within a custom ticketing system
  • Manually sending email notifications to remind users of tasks and events

You must select a notification template to determine the sender, recipient, and content for each message. For email notifications, your instance also requires a configured mail server.

Select a notification template.

If the out-of-the-box notification types don’t meet your needs, you can create custom notification types using client extensions. See Microservice Client Extensions for more information.

Add an Object Entry

Create an entry in a specified object. Example use cases include

  • Automatically adding entries in a custom Shipments object when orders are paid
  • Automatically adding a default user for new accounts
  • Manually adding a child ticket to the current ticket within a custom ticketing system

You must select an active object. You can then set predefined values for the entry’s fields. Enter these values directly or click Code ( Code ) to use expressions that set values dynamically. If the object includes required fields, you must set predefined values for them.

Select an active object and enter predefined values for the created entries.

Update an Object Entry

Update one or more fields in the current object entry. Example use cases include

  • Automatically updating an entry’s boolean field to true after users download its attached file
  • Manually updating a ticket’s assignee to the current user when clicking a button
  • Automatically updating an entry’s boolean field to true after users favorite it

You must select the field(s) to update in the current entry and enter new values. You can enter these values directly or click Code ( Code ) to use expressions that set values dynamically.

Select the fields from the current object entry that you want to edit and enter default values.

Webhook

Webhook actions deliver a data payload to a set URL. You must enter a target URL. If applicable, enter a secret.

Enter a webhook URL and secret.

Groovy Script

Important

As of DXP 2024.Q2/Portal 7.4 GA120, scripting is disabled by default. You can enable it in System Settings → Script Management (under the Security category).

Groovy Script actions execute Groovy scripts. Enter your script into the provided code window. For Liferay 7.4 U33+/GA33+, Liferay uses the GroovyShell class to validate Groovy script syntax when you click Save. If the script is invalid, Liferay displays a general error message.

Enter your Groovy script.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy