oo

Integrating Microservices

Liferay Self-Hosted Liferay SaaS Liferay PaaS

Liferay 7.4

You can define microservice client extensions to run your own code in response to events in your Liferay instance. How you implement the code is up to you: use the patterns and technologies you like. Microservice client extensions are hosted outside of Liferay and are triggered by cues from Liferay itself.

Microservice client extensions require pre-configured authentication profiles to handle requests properly and call protected Liferay APIs. You can add authentication profiles by including them as client extensions within the same project (e.g., OAuth user agent client extensions).

Microservice client extensions are hosted automatically when deployed within Liferay Cloud. If self-hosting a Liferay instance, you must host the microservices that these client extensions use separately.

Object Action Client Extensions

Object action client extensions define external action handlers that bind to an object definition’s action events. Your microservice’s handler code is executed when the object action occurs.

Use the type value in your client-extension.yaml file to specify an object action client extension:

type: objectAction

Object Validation Rule Client Extension

Object Validation Rule client extensions define custom validations that you can add to object definitions. They work by defining external event handlers that bind to object entry submission events and execute when users create or update entries. When creating these client extensions, you can use any number of conditions for determining valid field inputs, but each condition must set and return the validationCriteriaMet key as either true or false. See ObjectValidationRule1RestController for a basic example.

To use this type of client extension, add the objectValidationRule type to your client-extension.yaml file:

type: objectValidationRule

Once deployed, these client extensions appear as options when adding validations to an object definition. See Adding Field Validations for more information.

These client extensions appear as options when adding validations to an object definition.

Workflow Action Client Extensions

Workflow action client extensions define external workflow action handlers that bind to action events from a Liferay workflow. Your microservice’s handler code is executed when the workflow action occurs.

Use the type value in your client-extension.yaml file to specify a workflow action client extension:

type: workflowAction

Notification Type Client Extensions

Notification type client extensions define external notification handlers that bind to notification events in Liferay. Your microservice’s handler code is executed when the notification event occurs.

Use the type value in your client-extension.yaml file to specify a notification type client extension:

type: notificationType