Changed on:
30 Jan 2024
This module receives consignment updates from Fluent and creates/updates shipments in Adobe Commerce.
Key features:
The diagram below represents how an update from Fluent is processed in Adobe.
The settings below demonstrate how the handler is mapped to a Fluent Webhook message name. It is possible through Adobe’s dependency injection to add more or even override the default settings.
`1 <type name="FluentConnector\General\Api\WebHook\HandlerFactoryInterface"> 2 <arguments> 3 <argument name="handlers" xsi:type="array"> 4 <item name="ConsignmentStatusChanged" xsi:type="string">FluentConnector\Consignment\Handler\ConsignmentHandler</item> 5 </argument> 6 </arguments> 7 </type>`
There are a few different validations executed before the actual webhook processing begins. These validations are part of a validation chain configured at di.xml as follows:
`1 <virtualType name="consignmentValidatorChain" type="FluentConnector\General\Model\WebHook\MessageValidatorChain"> 2 <arguments> 3 <argument name="validators" xsi:type="array"> 4 <item name="consignmentEnableValidator" xsi:type="object">consignmentEnableValidation</item> 5 <item name="consignmentEntityTypeValidator" xsi:type="object">consignmentEntityTypeValidator</item> 6 <item name="orderStatusValidator" xsi:type="object">FluentConnector\Consignment\Model\WebHook\Validator\OrderValidator</item> 7 </argument> 8 </arguments> 9 </virtualType>`
Some of the validation includes:
The webhook execution simply adds the message to a queue to be processed asynchronously.
Topic name:
`fluentcommerce.consignment.updater`
Message content:
The extensions use Adobe's standard approach to process items waiting in a queue. The diagram below illustrates the sequence of events for each queued item.
The actual processing is done through commands which can be overridden or extended by Adobe’s dependency injection only.
`1 <virtualType name="consignmentProcessCommandPool" type="FluentConnector\Consignment\Model\Command\CommandPool"> 2 <arguments> 3 <argument name="commands" xsi:type="array"> 4 <item name="shipment" xsi:type="string">FluentConnector\Consignment\Model\Command\Order\Shipment</item> 5 </argument> 6 </arguments> 7 </virtualType>`
Event | Parameters | Description |
rootEntityRef | order.increment_id | order increment id |
data.consignmentById.consignmentArticles.consignmentArticleEdges[].consignmentArticleNode.fulfilments.fulfilmentEdges.fulfilmentNode.items.fulfilmentItemEdges[0].fulfilmentItemNode.orderItem.ref | order_item_id | order item id |
data.consignmentById.consignmentArticles.consignmentArticleEdges[].consignmentArticleNode.fulfilments.fulfilmentEdges.fulfilmentNode.items.fulfilmentItemEdges[0].fulfilmentItemNode.filledQuantity | shipped_qty | Shipped Qty |
data.consignmentById.status | status | The item's consignment status. Shipping and tracking status."status": "ACTIVE_LODGED" |
data.consignmentById.consignmentArticleEdges[].consignmentArticleNode.fulfilments.fulfilmentEdges.fulfilmentNode | fulfilment ID | Keep as an extension attribute |
Event | Description | Parameters |
fluent_consignment_process_before | Event before the consignment is processed | order of type OrderInterface consignment of type array |
fluent_consignment_process_after | Event after the consignment is processed | order of type OrderInterface consignment of type array |
Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.