cx-composer--for=liferay

Object Validation Rule

Validate a Liferay Object entry via an external service.

type: objectValidationRule·Microservice·Liferay docs →

# description

Registers a webhook that Liferay calls to validate an Object entry. Return `valid: false` and Liferay rejects the write with your error message.

Externalize business logic — actions, validation, workflow, notifications.

# when to use

  • Validation rules are more complex than the built-in expression language supports.
  • You need to validate against a live external source (address lookup, uniqueness across systems).

# how to use

  1. 01Ship a paired oAuthApplicationUserAgent.
  2. 02Set resourcePath: to your validation handler; return {valid: bool, errorMessage: string}.

# required fields

fieldtypedescription
resourcePathrequiredstringValidation handler path.
oAuth2ApplicationExternalReferenceCoderequiredstringRef code of the paired oAuthApplicationUserAgent.

# optional fields

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

# example

client-extension.yaml
address-validation:
    type: objectValidationRule
    name: Address Validation
    resourcePath: /validate/address
    oAuth2ApplicationExternalReferenceCode: my-oauth-ua

# related types

Usually shipped alongside Object Validation Rule:

# more in microservice