Accelerator B2B Simulator Process API - Implementation Template
Data mappings
This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables.
Module | Description |
---|---|
order-shipped-event | Create an OrderShippedEvent from Fulfillment Orders |
invoice-810-to-cim | Maps X12 Message to CIM OrderInvoiceNotice |
cim-to-820-payment | Maps CIM OrderInvoiceNotice to X12 8020 Message |
order-shipped-event
Create an OrderShippedEvent from Fulfillment Orders
Source:
./src/main/resources/dwl/order-shipped-event.dwl
Variables
var groupFulfillmentOrderByToLocation
Grouping of Fulfillment Orders that has same Location Code or Address Line1 to simulate creation of OrderShippedEvent per address.
The assumption is that fulfillment orders may belong to different orders but if they have same address and they can be shipped together as one shipment.
var packageIds
Generates a packageId for all FulfillmentOrderProducts that belong to a FulfillmentOrder. The requirement is to create a Shipment for
each Address even if the fulfillment Orders belong to different Sales Orders. In Case of OMS the Order Allocation Notice will hold multiple
fulfillment orders for the same Order Summary and each fulfillment Order has a different address.
Functions
fun auditInfo ()
Create a new audit block
Mapping Tables
Maps CIM Fulfillment Orders to a new OrderShippedEvent
CIM OrderShippedEvent | CIM Fulfillment Order | Description |
---|---|---|
id | fulfillmentOrders.salesOrderId | Sales Order ID |
orderEventType | "OrderShippedEvent" | Defaulted to OrderShippedEvent |
purchasingOrganizationCode | purchasingOrganizationCode | Organization Code of Purchase Order |
fulfillmentOrders | fulfillmentOrders | Fulfillment Orders as received from incoming request or as per ERP |
shipment.id | uuid | A unique Id for Shipment |
shipment.shipmentNumber | "SP-10000000" | A unique number generated for each Shipment in format of "SP-" |
shipment.shipmentDate | (now()) as Date | Simulated as Shipment Date |
shipment.shipToLocation | fulfillmentOrders[0].fulfilledToLocation | Location based on Fulfillment Order |
shipments.fulfillmentOrderId | fulfillmentOrders.Id | Id of the Fulfillment Order |
shipments.falesOrderId | fulfillmentOrders.SalesOrderId | Sales Order Id of the fulfillment Order |
shipment.orderDeliveryMethodId | fulfillmentOrders.OrderDeliveryMethodId | Delivery Method associated with Account |
shipment.isGift | False | Default value as false |
shipment.shipmentStatus | DISPATCHED | Status marked as Dispatched |
shipment.scheduledDeliveryDateTime | 3D | In next 3 days |
shipment.estimatedDeliveryDateTime | 3D | In next 3 days |
shipment.carrierTrackingNumber | uuid | UUID with '-' removed for each Shipment |
shipment.specialInstructionsText | None | Default message if any |
shipmentDocuments.id | uuid | UUID for Shipment Document based on Fulfillment Order |
shipmentDocuments.contentDocumentVersion | 1.0 | Default version as 1.0 |
shipmentDocuments.shipmentPackageId | uuid | UUID for Shipment Package based on Fulfillment Order |
shipmentPackages.id | uuid | UUID for Shipment Package based on Fulfillment Order |
shipmentPackages.ShipmentProductCount | fulfillmentOrders | Count of Products in each fulfillment order |
shipmentProducts.id | fulfillmentOrders.salesOrderProductId | Product Id of products in each fulfillment order |
shipmentProducts.productCode | fulfillmentOrders.productCode | Product Code of products in each fulfillment order |
shipmentProducts.fulfillmentOrderProductId | fulfillmentOrders.Id | Product Id of products in each fulfillment order |
shipmentProducts.quantity | fulfillmentOrders.fulfilledQuantity | Quantity for each product in each fulfillment order |
shipmentProducts.shipmentPackageId | fulfillmentOrders.Id | UUID for Shipment Package based on Fulfillment Order |
invoice-810-to-cim
Maps X12 Message to CIM OrderInvoiceNotice
Source:
./src/main/resources/dwl/invoice-810-to-cim.dwl
Mapping Tables
Maps X12 8010 Message to CIM Order InvoiceNotice
CIM Order InvoiceNotice | X12 8010 Message | Description |
---|---|---|
id | uuid | A unique id for Invoice |
purchaseOrderNumber | TransactionSets.v004010."810".Heading."020_BIG".BIG04 | Purchase Order associated with Invoice |
purchaseOrderDate | TransactionSets.v004010."810"[0].Heading."020_BIG".BIG03 | Date of Purchase Order |
purchasingOrganizationCode | TransactionSets.v004010."810".Group.GS03 | Organization Code of Purchase Order |
invoices.id | uuid | Unique Id as referenced for each Invoice |
invoices.invoiceNumber | TransactionSets.v004010."810".Heading."050_REF".REF01.REF02 | Invoice Number as referenced for each Invoice |
invoices.purchaseOrderNumber | TransactionSets.v004010."810".Heading."050_REF".REF01.REF02 | Purchase Order Number as referenced for each Invoice |
invoices.billToCustomerId | TransactionSets.v004010."810".Group.GS03 | Customer Id referenced for each Invoice |
invoices.invoiceStatus | Valid | Default Status for Invoice |
invoices.invoiceDate | TransactionSets.v004010."810".Heading."020_BIG"."BIG01" | Date of Invoice |
invoices.invoiceAmount | TransactionSets.v004010."810".Summary."010_TDS".TDS01 | Amount on Invoice |
cim-to-820-payment
Maps CIM OrderInvoiceNotice to X12 8020 Message
Source:
./src/main/resources/dwl/cim-to-820-payment.dwl
Mapping Tables
Maps CIM Order InvoiceNotice to X12 8020 Message
X12 8020 Message | CIM Order InvoiceNotice | Description |
---|---|---|
id | uuid | A unique id for Invoice |
purchaseOrderNumber | TransactionSets.v004010."810".Heading."020_BIG".BIG04 | Purchase Order associated with Invoice |
purchaseOrderDate | TransactionSets.v004010."810".Heading."020_BIG".BIG03 | Date of Purchase Order |
Interchange.ISA06 | purchasingOrganizationCode | Organization Code on Purchase Order |
Interchange.ISA08 | Supplier Id | Supplier Id from configurations |
Interchange.ISA09 | now | Current Date |
Interchange.ISA10 | now | Current Time in HHmm format |
Group.GS02 | Supplier Id | Supplier Id from configurations |
Group.GS03 | now | Current Date |
Group.GS04 | now | Current Time in HHmmss format |
TransactionSets.v004010.820.Heading.BPR02 | invoiceAmount | Invoice Amount |
TransactionSets.v004010.820.Heading.020_BPR.BPR02 | invoiceAmount | Invoice Amount |
TransactionSets.v004010.820.Heading.050_REF.REF02 | purchaseOrderNumber | Organization Code of Purchase Order |
TransactionSets.v004010.820.Detail.010_ENT_Loop.ENT04 | purchasingOrganizationCode | Organization Code on Purchase Order |
TransactionSets.v004010.820.Detail.010_ENT_Loop.ENT04.150_RMR_Loop.150_RMR.RMR02 | invoiceAmount | Invoice Amount |
TransactionSets.v004010.820.Detail.010_ENT_Loop.ENT04.150_RMR_Loop.150_RMR.RMR04 | invoiceAmount | Invoice Amount |
TransactionSets.v004010.820.Detail.010_ENT_Loop.ENT04.150_RMR_Loop.150_RMR.RMR05 | invoiceAmount | Invoice Amount |