Designing Mule Flows

After configuring the Liferay Connector to MuleSoft, you can start building Mule flows. These operations are available for Liferay’s OpenAPI endpoints.

  • Create Records
  • Delete Records
  • Get Records
  • Update Records
  • Batch - Export Records
  • Batch - Import Records - Create
  • Batch - Import Records - Delete
  • Batch - Import Records - Update

If you’re working with large data sets, use Liferay’s batch operations to submit and process data more quickly.

Create Records Operation

This operation exposes all endpoints handled by the POST method for the chosen OpenAPI 3.0 document. Use Liferay’s API Explorer at http://[host]:[port]/o/api as a reference for the different operations supported by the Liferay MuleSoft connector. You can also use the OpenAPI document from the endpoint in the connector’s configuration.

The products endpoint creates a new product using HTTP POST.

After selecting an endpoint, the connector automatically generates related metadata. You can then specify input parameters. Input parameters support all Liferay RESTful web services but are not necessary for every endpoint:

Parameter nameTypeDescriptionRequired
EndpointStringDrop-down list of available endpoints that support create operationYes
RecordsObjectObject to be createdYes
Path ParamsObjectMap with path parameter valuesYes (if required by endpoint)
Query ParamsObjectMap with query parameter valuesNo

Use the products endpoint in flows that import products from Salesforce to Liferay.

You can follow the above steps to configure and use other operations in your flow.

Batch Export Operation

With this operation you can get all records of a specified entity with a single request. This is useful when you have a lot of records. When there are only a few records, use the Get Records operation.

Use the Batch - Export Records operation to export multiple records.

To configure a batch export operation, select the entity you want to export using the Class name drop-down. Once selected, the connector dynamically generates related output metadata. If desired, you can use the Field names input to specify the fields to include in the exported entity. Field names must be separated using commas. You can also specify a Site ID parameter if required by the batch processing logic.

Parameter nameTypeDescriptionRequired
Class nameStringThe class name of the exported entityYes
Site IDStringThe siteId query parameterNo
Field namesStringComma separated list of exported entity fieldsNo

Executing this flow results in a JSON array that is ready for transformation and loading into another application.

Batch Import Operations

There are three available batch import operations: create, delete, and update. Each operation imports a set of entities, but Liferay’s batch engine processes them differently. The image below shows a batch import create operation.

Use the Batch - Import Records operation to import bulk records.

To configure a batch import operation, first use the Class name drop-down to select the entity you want to import. Once selected, the connector dynamically generates related input metadata. Then, use the Record field to submit a JSON array of entity objects. If desired, use the Field name mappings drop-down to map field names between related entities from different systems.

note

If you’ve used the Transform Message module to map entity fields between source and destination systems, you can leave Field name mappings empty.

Parameter nameTypeDescriptionRequired
Class nameStringThe class name of the imported entityYes
Field name mappingsObjectPopulated with field name mapping definitionsNo
RecordsObjectJSON array of entity objectsYes

To view all available operations and related input parameters, see Liferay MuleSoft Connector Technical Reference.

Capabilities

Product

Contact Us

Connect

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