Below is an example showing how the Magento Connector Business Process can be used. In the following example, CustomerCustomerRepositoryV1GetListGet.bps (from the Connector Project) is used to retrieve the existing customers from the Magento application. This is followed by a step (Ruleset) that will then transform the received data.
Steps to create the Connector and Integration Projects:
- Create a Magento Connector Project.
- Create the Integration project (CIC Project).
- Set the Connector Project as a dependency in the Integration Project.
- To perform an operation using the Connector BP and Schemas, follow the below steps:
4a. Create a Business Process in the Integration Project.
4b. Create a task in the above BP to include the BP from the Connector Project i.e. CustomerCustomerRepositoryV1GetListGet.bps
For the CustomerCustomerRepositoryV1GetListGet.bps, provide one of the searchCriteria parameters.
In the above example, the response is sorted in ascending order based on first name. The field searchCriteriasortOrders0field must specify the field name on which the sort needs to be applied and the field searchCriteriasortOrders0direction must specify the sort order i.e. ASC or DESC
4c. Create another task in the BP - a Ruleset. This Ruleset maps the JSON Schema to any Cleo-supported Schema. All the Connector Schemas (request and response) are JSON format. In this Ruleset, map all required fields (id, firstname, lastname, email etc.)
For more information on the searchCriteria field please refer to https://devdocs.magento.com/guides/v2.4/rest/performing-searches.html