Incrementally import recently updated products with Spryker Middleware Powered by Alumio
Edit on GitHubThis document describes how to import products that have recently been updated. Following the described procedure, you can import products that have been updated within the past day.
To run the incremental import of products, follow these steps.
1. Configure the Spryker Middleware Powered by Alumio connection with Akeneo PIM and Spryker
- If you create the new configuration, follow Configure the Spryker Middleware Powered by Alumio connection with Akeneo PIM and SCCOS.
- If you update the existing configuration, proceed with 3. Create an incoming configuration.
2. Configure the data mapping between Akeneo and Spryker
- If you create a new configuration, follow Configure data mapping between Akeneo and SCCOS.
- If you update the existing configuration, proceed with 3. Create an incoming configuration.
3. Create an incoming configuration
- In Spryker Middleware powered by Alumio, go to Connections > Incoming and click +. This opens the Create an incoming configuration page.
- For Name, enter the name for this configuration. As you are entering the name, the Identifier is automatically populated.
- Optional: For Description, add the description of the configuration.
- To activate the incoming configuration after creating, make sure Status is set to Enabled.
- For Subscriber, enter and select HTTP Subscriber.
- For Request URI, enter
/api/rest/v1/products
. - In HTTP Client, enter and select the Akeneo client you created in Connect Akeneo with Spryker Middleware powered by Alumio.
- For Input transformer, select Chain.
- Click Add data transformer.
- For Select a prototype, select Value setter.
- For Key, enter
lastTimestamp
.
- Click Add data transformer.
- For Select a prototype, select Get an entity from storage.
- For Storage, enter and select the storage you created. For example, [Default] Akeneo to Spryker - Products - update lastTimestamp. For instructions on creating new storage, see Create cache.
- For Storage entity identifier, enter
lastTimestamp
. - For Destination, enter
lastTimestamp
.
- Click Add data transformer.
- For Select a prototype, select Conditional transformer.
- For If all conditions are met, select Value condition.
- For Accessor, select Pattern accessor.
- For Pattern, enter
lastTimestamp
. - For Conditions, click Add conditions.
- For Select a prototype, select is empty.
- In Then apply transformer, for Select a prototype, select Value setter.
- For Key, enter
LastTimestamp
. - For Value, select string and enter
-1 day
. - For Mappers, click Add a mapper.
- For Select a prototype, select Format: Date.
- For Output format, enter
Y-m-d H:i:s
.
- For Follow pagination, select Follow next links.
- For Pattern to the link for the next page, enter
_links.next.href
. - In Maximum number of pages to fetch, enter the needed value. For example, 100.
- For Entity schema, select Akeneo Product.
- Click Save & continue. This opens the edit page for this configuration with a success message displayed.
4. Create an outgoing connection
For the incremental import to work, you need to add to your outgoing connection an additional entity transformer with two data transformers in it.
To create the additional transformer, follow the steps:
-
In the Spryker Middleware powered by Alumio platform, go to Connections > Entity transformers and click +. This opens the Create an entity transformer page.
-
For Name, enter the name for the entity transformer. As you are entering the name, the Identifier is automatically populated based on the name.
-
Optional: In Description, add the description for the transformer.
-
To activate the entity transformer after creating, set the status to Enabled.
-
For Settings, select Chain multiple entity transformers. add entity transformer
-
Click Add entity transformer.
-
For Select a prototype or configuration, enter and select Data, transform using mappers and conditions. This is the first data transformer in the entity transformer.
-
In Data transformers click Add data transformer.
-
For Select a prototype, enter and select Value setter.
-
For Configurations > Key, enter
lastTimestamp
. -
For Value, select string and enter
&{updated}
. -
In Mappers, click Add a mapper.
-
For Select a prototype, enter and select String: Replace.
-
For Search, enter
T
. -
Click Add a mapper.
-
For Select a prototype, enter and select String: Cut.
-
For Start, enter
0
. -
For Length, enter
19
.
- Click Add entity transformer.
- For Select a prototype or configuration, enter and select Data, transform using mappers and conditions This is the second data transformer in the entity transformer.
- In Data transformers click Add data transformer.
- For Select a prototype, enter and select select Save entity to storage.
- For Storage, enter and select the storage you created when establishing the incoming configuration at Create an incoming configuration. In our example, it’s [Default] Akeneo to Spryker - Products - update lastTimestamp.
- For Storage entity identifier, enter
lastTimestamp
. - For Source, enter
lastTimestamp
. - Click Save & continue. This opens the edit page for this connection with a success message displayed.
5. Define the route
Define the route as described in Define the route.
6. Create tasks and import products from Akeneo to SCCOS
Follow the instructions in Create tasks and import products from Akeneo to SCCOS.
Thank you!
For submitting the form