cx-composer--for=liferay

Object Action

Run custom logic when a Liferay Object event fires.

type: objectAction·Microservice·Liferay docs →

# 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

  1. 01Ship a sibling oAuthApplicationUserAgent extension and reference its code via oAuth2ApplicationExternalReferenceCode.
  2. 02Set resourcePath: to the endpoint (relative to the OAuth app's homePageURL).
  3. 03Optionally restrict which Objects trigger the action via allowedObjectDefinitionNames.

# required fields

fieldtypedescription
resourcePathrequiredstringHandler path (relative to the OAuth app's homePageURL).
oAuth2ApplicationExternalReferenceCoderequiredstringRef code of the paired oAuthApplicationUserAgent.

# optional fields

fieldtypedescription
namestringDisplay name.
allowedObjectDefinitionNamesstring[]Restrict to specific Liferay Objects.
dxp.lxc.liferay.com.virtualInstanceIdstringScope to a virtual instance.

# example

client-extension.yaml
notify-slack:
    type: objectAction
    name: Notify Slack
    resourcePath: /actions/slack
    oAuth2ApplicationExternalReferenceCode: my-oauth-ua
    allowedObjectDefinitionNames:
        - C_Order

# related types

Usually shipped alongside Object Action:

# more in microservice