Warehouse Position - Batch Mode of Data Loading
In the Batch mode multiple rows can be loaded into the database from the one EagleML message. In this mode the element warehouseTransaction can contain several complex elements warehousePosition. Data from every element will be loaded into a separate database row.
See the example of incoming EagleML message to load data in Batch Mode:
Batch Key Element
When using batch mode, the data of the complex Warehouse Position elements should contain the same set of element values: Entity Id + Effective Date + Source Name. The set of values for grouping should be specified in the Warehouse Transaction/batchKey element.
Batch Key (Warehouse Transaction/batchKey element) has the following format: entityId^effectiveDate^sourceName
entityId – the Warehouse Transaction/Warehouse Position/entityId element. Should be specified if it is mapped from the EagleML message directly (in the Warehouse Transaction/Warehouse Position/entityId). If the value of entityId is defined by the Warehouse Transaction/Warehouse Position/xrefAccountId and Warehouse Transaction/Warehouse Position/xrefAccountIdType elements, the first part of Warehouse Transaction/batchKey can contain anything. The batch key will be updated by the entityId element calculated.
effectiveDate – the Warehouse Transaction/Warehouse Position/effectiveDate element. Should be specified in Data format YYYYMMDD.
sourceName – the Warehouse Transaction/Warehouse Position/sourceName element.
Examples of valid Batch Key:
<batchKey>COMPTST1^20140120^EAGLE PACE</batchKey>
<batchKey>entity^20140120^EAGLE PACE</batchKey>
Delete Data
Before inserting, Batch mode will always try to delete records defined by warehouseTransaction/batchKey element.
Besides Position DB tables, a data is deleted also from the following Open Lot DB tables:
HOLDINGDBO.LOT_LEVEL_POSITION
HOLDINGDBO.POSITION_COST_LOT
Set flag warehouseTransaction/warehousePosition/openLotDeleteSwitch to 'N' for saving a data in Open Lot tables:
<openLotDeleteSwitch>N</openLotDeleteSwitch>
In other cases data will be deleted. Default value of openLotDeleteSwitch is 'Y'.
Insert/Update
The stored procedure for the batch mode supports only inserting data into the database. All data is inserted by batch commit, which means one transaction for all records specified in one incoming message.
Use Single Row Upsert mode for updating a database row.
Other
The value for the field HOLDINGDBO.POSITION.POSITION_ID in all rows which are loaded from one EagleML message in Batch Mode will be identical. This value is calculated in the stored procedure for loading Warehouse Position data – taken the following instance value. Also it is mapped to the field HOLDINGDBO.POSITION_DETAIL.POSITION_ID DB field.