Object Action
Run custom logic when a Liferay Object event fires.
# description
Registers an HTTP endpoint that Liferay calls when a configured Object event (create / update / delete) fires. Your service receives the payload and does what it likes — enrich, notify, replicate to another system, trigger a workflow. Object Actions are Liferay's webhook mechanism for Liferay Objects: they run out-of-process (in your microservice), so heavy work doesn't block the Liferay JVM. Every Object Action needs a sibling `oAuthApplicationUserAgent` extension so Liferay can authenticate the outbound call using OAuth 2.0. Restrict which Object types trigger the action via `allowedObjectDefinitionNames` — omit it and every Object type will fire the webhook.
Externalize business logic — actions, validation, workflow, notifications.
# when to use
- →You need to react to Liferay Object events with logic that lives outside Liferay.
- →You're integrating another system (CRM, warehouse, analytics) with a Liferay Object.
# how to use
- 01Ship a sibling
oAuthApplicationUserAgentextension and reference its code viaoAuth2ApplicationExternalReferenceCode. - 02Set
resourcePath:to the endpoint (relative to the OAuth app'shomePageURL). - 03Optionally restrict which Objects trigger the action via
allowedObjectDefinitionNames.
# required fields
| field | type | description |
|---|---|---|
resourcePathrequired | string | Handler path (relative to the OAuth app's homePageURL). |
oAuth2ApplicationExternalReferenceCoderequired | string | Ref code of the paired oAuthApplicationUserAgent. |
# optional fields
| field | type | description |
|---|---|---|
name | string | Display name. |
allowedObjectDefinitionNames | string[] | Restrict to specific Liferay Objects. |
dxp.lxc.liferay.com.virtualInstanceId | string | Scope to a virtual instance. |
# example
notify-slack:
type: objectAction
name: Notify Slack
resourcePath: /actions/slack
oAuth2ApplicationExternalReferenceCode: my-oauth-ua
allowedObjectDefinitionNames:
- C_Order# related types
Usually shipped alongside Object Action: