Functional documentation for the Aiden WMS purchase document update mapper (inbound).
This document describes what happens after the mapper is installed: how a WMS purchase document status update is written back to SAP Business One (B1) as a PATCH on the related B1 document. It is intended for end-users and functional consultants.
1. Overview
|
|
|
|---|---|
|
Source |
Aiden WMS purchase document status message (Kafka) — single document or multi-document payload with |
|
Target |
SAP B1 document UDF update via Service Layer PATCH |
|
Purpose |
Synchronize WMS purchase document status onto the linked B1 document ( |
This is a minimal status-sync integration. It does not create goods receipt POs, inventory documents, or lines. It only patches a status UDF on an existing B1 document (typically a purchase order).
What gets updated
|
B1 field |
Meaning |
|---|---|
|
|
Latest WMS document status (e.g. |
Which B1 document is patched?
The Service Layer endpoint is built at runtime from WMS custom fields:
PATCH {cf_objectType}({cf_externalId})
Example from inputExample.json: cf_objectType = PurchaseOrders, cf_externalId = 9417 →
PATCH PurchaseOrders(9417)
with body:
{ "U_AEN_WMS_STATUS": "Started" }
2. What the mapper uses as input
2.1 Message shapes
The integration accepts two payload shapes. Custom-field paths differ:
|
Shape |
How it is handled |
Where |
|---|---|---|
|
Root object with |
Each element of |
On each document root: |
|
Single document envelope (no |
Mapped once |
Nested: |
After split (if any), MapForce expects a document-level object that includes at least:
-
status— WMS status string (what is mapped) -
(optional on input schema)
documentId,documentType,user— present but not mapped to B1 body
Other WMS fields (business partner, lines, saved lines, receive dates, etc.) may appear on real messages (see inputExample.json) but are not mapped into the B1 PATCH body.
2.2 External application id / correlation
|
Value |
Source |
Use |
|---|---|---|
|
Integration message id |
Kafka key |
XIAM correlation |
|
External application id |
WMS |
XIAM external application id |
|
Mapped status |
After MapForce |
PATCH body |
There is no B1 GET enrichment step in this project.
3. Business behavior
3.1 Split multi-document messages
If the Kafka payload contains $.documents:
-
The route logs that an array of documents was received.
-
Each document is processed independently.
-
For each document: external id = that document’s
documentId; custom fields from that document’scustomFields. -
Each document produces outbound Kafka traffic with its own PATCH endpoint.
If documents is absent, the single-message branch runs and reads nested document.customFields.
3.2 Status mapping (MapForce)
|
WMS field |
B1 field |
Rule |
|---|---|---|
|
|
|
Direct copy (no valuemap) |
Any status string WMS sends is written as-is. Align allowed WMS statuses with what B1 users expect on the UDF.
Note on nested single-message payloads: MapForce’s input schema exposes status at the root of the object it receives. In the single-message example, root status is Started while nested document.status is Busy. The mapped UDF follows the root status of the JSON body passed into MapForce (after any split). For multi-doc splits, that is each document element’s own status.
3.3 Dynamic PATCH endpoint (Camel)
Before the parent route publishes with headers, Camel sets:
|
Header |
Value |
|---|---|
|
HTTP method |
|
|
HTTP endpoint |
|
|
WMS custom field |
Role |
Example |
|---|---|---|
|
|
B1 Service Layer entity set name |
|
|
|
B1 document key in the URL |
|
Consultant impact:
cf_objectTypemust match a real B1 Service Layer collection.
cf_externalIdmust be the correct B1 key (usuallyDocEntry).Single-message payloads must place these under
document.customFields.Multi-document payloads must place them under each
documents[].customFields.These fields are not produced by MapForce; they are read only in the Camel route for headers and external id.
3.4 Runtime publish behavior (for support/maintainers)
In the current MainRoutes implementation:
-
ROUTE_MAPPERruns MapForce, writes mapped status, and already sends the body toto.kafka. -
The parent branch then sets PATCH headers and sends again to
to.kafka.
Functionally, status mapping and the intended PATCH endpoint headers are defined as above. Maintainers should be aware of this double-publish path when troubleshooting duplicate Kafka messages or messages without headers.
3.5 What is intentionally not done
-
No line, batch, serial, package, or expense mapping
-
No creation of new B1 documents (PATCH only)
-
No warehouse master or BOM logic
-
No status translation table in MapForce
-
Does not set native B1
DocumentStatus— only UDFU_AEN_WMS_STATUS
4. Field mapping tables
Columns: B1 target field | WMS / source input | What happens | Notes
4.1 PATCH body (MapForce)
|
B1 target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Direct copy |
Only mapped body field |
4.2 PATCH routing (Camel — not in MapForce body)
|
Runtime setting |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
HTTP method |
— |
Constant |
Always on parent publish path |
|
HTTP endpoint |
|
Format |
Path depends on message shape (§2.1) |
|
External application id |
|
Direct |
Per document |
|
Multi-doc fan-out |
Root |
Split then map each |
Optional |
|
Single-doc custom fields |
|
Nested path |
See |
4.3 Not mapped (examples)
Although the output schema lists a full B1 document shape, the following are not written by this mapper (non-exhaustive):
|
Topic |
Behavior |
|---|---|
|
|
Unwired |
|
|
Unwired |
|
|
Unwired in this MFD |
|
WMS lines / savedLines / BP |
Not used in PATCH body |
5. Value translations (reference)
5.1 Status
|
WMS |
B1 |
|---|---|
|
(any string) |
Same string |
No closed/open prefix stripping and no valuemap in this project.
5.2 Endpoint pattern
|
Inputs |
Result |
|---|---|
|
|
|
|
|
|
5.3 Message handling
|
Payload |
Custom field path |
Behavior |
|---|---|---|
|
Has |
|
One processing path per document element |
|
No |
|
Single processing path |
6. What is not mapped / important omissions
|
Topic |
Behavior |
|---|---|
|
Full B1 document update |
Only status UDF is mapped |
|
Document create/close in B1 native status |
Does not set B1 |
|
Validation of object type / DocEntry |
No mapper-side check; failures surface at Service Layer |
|
Lines / inventory / serials / goods receipt posting |
Out of scope for this mapper |
|
Scenario |
Dummy placeholder — not a reliable expected sample |
7. End-to-end expectation (happy path)
-
WMS updates a purchase document status (e.g. receiving started or document closed).
-
Integration receives Kafka message (single envelope or
documents[]). -
For each logical document:
-
Resolve
cf_objectType/cf_externalIdfrom the correct custom-fields path -
Map root/document
status→{ "U_AEN_WMS_STATUS": "<status>" } -
PATCH that B1 entity
-
-
B1 document shows the latest WMS status on UDF
U_AEN_WMS_STATUS.
8. Example (from mappings/inputExample.json)
Scenarios under scenario_files/1_mainRoute are placeholders. Prefer this example.
WMS input (excerpt)
|
Field |
Value |
|---|---|
|
Root |
|
|
Root |
|
|
Root |
|
|
Nested |
|
|
|
|
|
|
|
|
Lines / savedLines |
Present on message but not mapped |
Expected B1 PATCH
|
Setting |
Value |
|---|---|
|
Method |
|
|
Endpoint |
|
|
Body |
|
9. Implementation checklist for consultants
-
For single-message payloads, put
cf_objectTypeandcf_externalIdunderdocument.customFields. -
For multi-document payloads, put those fields under each
documents[].customFields. -
Ensure
cf_objectTypeis a valid B1 collection (e.g.PurchaseOrders). -
Ensure
cf_externalIdis the B1 DocEntry of the document to update. -
Align WMS
statusvalues with UDF reporting expectations in B1. -
Remember this flow only updates
U_AEN_WMS_STATUS— it does not post purchase receipts or stock. -
Use
documentId/ XIAM external application id for support tracing.
10. Source artifacts (for reference)
|
Artifact |
Role |
|---|---|
|
|
MapForce mapping ( |
|
|
WMS input contract / realistic sample |
|
|
B1-shaped output schema (mostly unused fields) |
|
|
Split, nested custom fields, PATCH headers, Kafka |
|
|
MapForce runner |
|
|
Placeholder samples (dummy) |
Generated from the mapping definition and integration behavior in this project. If the MapForce mapping or routing changes, this document should be reviewed and updated.
Maintaining this document
For the original documentation intent, when to update, source-of-truth checklist, and a ready-made refresh prompt, see README.md and the repository AGENTS.md.