Skip to end of banner
Go to start of banner

Data Integration Layer

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The data integration strategy is using the required Boxalino Data Integration Data Structures Data Structure

The DI plugin, provided by Boxalino with the purpose of Shopware6 integrations, is following the documented schemas and property definitions.

Integration Strategy

The integration strategy is done per content type (product, order, user, etc) and integration mode (delta, full, instant), as described in the public wiki https://github.com/boxalino/rtux-integration-shopware/wiki/DI:-Data-Integration

The full & delta can be integrated via console commands (for server crons) or with the use of Shopware6 Scheduled Task.

The instant update is integrated via Event Subscribers.

The integration strategy is handled by the integration team.

Integration Flow

The integration flow has a generic design and is described in the base repository data-integration-doc-php https://github.com/boxalino/data-integration-doc-php/wiki/4.-Integration-Strategy

The elements part of the Data Integration strategy are:

1.Integration Handler

There is an integration handler per data type and integration mode.

  1. is aware of the integration mode & type (required header for the DI requests)

  2. is setting the required headers tm & ts for the process

  3. requires the configurations for the process

  4. is aware of the list of document handlers required for the given data sync (ex: for product - the doc_language, doc_attribute, doc_attribute_value & doc_product https://github.com/boxalino/rtux-integration-shopware/blob/3.0.0/src/Resources/config/services/di/product-console.xml#L27 )

  5. calls the “integrate” behavior of every document handler https://github.com/boxalino/data-integration-doc-php/blob/3.0.0/src/Service/Integration/Mode/FullIntegrationTrait.php#L39

  6. makes the “sync” call to the DI endpoint Sync Request

2.Document handler

  1. is aware of the document type (required header for the DI request) https://github.com/boxalino/data-integration-doc-php/blob/3.0.0/src/Service/Integration/Doc/DocOrder.php#L36

  2. is aware of the document schema https://github.com/boxalino/data-integration-doc-php/blob/3.0.0/src/Service/Integration/Doc/DocOrder.php#L45

  3. getValues() from the list of property handlers and creates the document content via addDocLine (ex: order )

  4. makes the “load” call to the DI endpoint Load Request

3.Property Handlers

  1. manages the export for a given property (ex: price)

  2. can be activated for the instant mode (via “allowInstantMode” method) (disabled by default)

  3. are added to the document handler in the Integration Layer, which makes it 100% configurable

Data Mapping

Due to the nature of the integration process, there must be done a mapping between e-shop/Shopware6 fields and the documented schema properties.

The following mapping strategies are used in the Data Integration Layer:

  1. for generic source handlers (ex: the services loading information from the main tables - order, product, customer) :

    1. addPropertyNameDocMapping function https://github.com/boxalino/data-integration-shopware6/blob/master/src/Resources/config/product.xml#L161 (ex: product_number is mapped to sku, is_closeout is mapped to show_out_of_stock, restock_time/purchase_price is a numeric_attribute, etc)

    2. addSchemaDefinition function https://github.com/boxalino/data-integration-shopware6/blob/master/src/Resources/config/product.xml#L297 - it will translate the given field to the assigned schema

    3. this is used thoroughly for Service\Document\Order\Entity, Service\Document\User\Entity & Service\Document\Product\Attribute\Entity

  2. property handlers for specific properties (ex: categories, stock, price, order billing, order shipping ,etc) via addPropertyHandler

    1. helps isolate the source of your data (ex: project DB, other sources, etc) and translates them to the required data structure

    2. allows to add multiple custom property types dynamically, as part of your integration layer (ex: extend the DocOrderHandlerInterface with other order sources, change the default/generic property handlers for stock assigned to the DocProductHandlerInterface, etc)

Every document handler, via the createDocLines() function, will generate the document data by merging the values provided by each DocSchemaHandlerIntefrace (content source), grouping them by entity ID. The output will be transformed to the document line object with Every document line/row/item is a representation of the required Data Structure (as documented by Boxalino Data Structure )

Property Handler Options

Edit the property handler in your Doc<Type>HandlerInterface service (ex: product doc handler):

<call method="addPropertyHandler">
    <argument type="service" id="new-property-handler-service-id"/>
</call>

We recommend to replicate an existing handler in your Integration Layer and update the _getQuery() function (ex: to replace the logic for stock).

Make sure to test your new property handlers for all integration modes (delta, full, instant)

  • No labels