ArchiveBOD
You can use the ArchiveBOD function for ION integrations with Optiva to archive Business Object Documents (BODs) for debugging and auditing.
The ArchiveBOD places the supplied XML string representation of a BOD into the FsActionWipResults table, allowing you to examine the BOD directly within Optiva without having to search for it in ION. This function works for published (outbound) and consumed (inbound) BODs.
When to use
You can use this function to archive BODs for troubleshooting integration issues without searching the ION logs. This keeps all the diagnostic data within Optiva.
When not to use
You cannot use this function to archive all the BODs in high frequency integrations without a cleanup as the FsActionWipResults table will increase rapidly.
Syntax
void ArchiveBOD(string BODId, string theBOD);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| BODId | string | Yes | The unique identifier for a BOD. It must be unique to distinguish between different BOD archives. |
| theBOD | string | Optional | The XML string representation of the Business Object Document to archive. |
Return Value
The application returns a void (no return value).
Example
- Example 1
-
Archive Published BOD
// Publishing a BOD and archiving it for reference public void PublishItemBOD(string itemCode) { // Create BOD XML string bodXml = @"<?xml version='1.0' encoding='UTF-8'?> <Sync> <ApplicationArea> <Sender>Optiva</Sender> <CreationDateTime>2024-03-10T14:00:00</CreationDateTime> </ApplicationArea> <DataArea> <Item> <ItemID>" + itemCode + @"</ItemID> <Description>Raw Material Item</Description> </Item> </DataArea> </Sync>"; // Generate unique BOD ID string bodID = "ITEM_SYNC_" + itemCode + "_" + DateTime.Now.ToString("yyyyMMddHHmmss"); // Archive the BOD before publishing ArchiveBOD(bodID, bodXml); AddTraceLog("BOD archived with ID: " + bodID); // Now publish the BOD to ION PublishToION(bodXml); }
- Example 2
-
Archive Consumed BOD
// Receiving and archiving an inbound BOD from ION public void ProcessInboundBOD(string receivedBodXml) { // Generate unique ID for received BOD string bodID = "RECEIVED_" + Guid.NewGuid().ToString(); // Archive the received BOD for troubleshooting ArchiveBOD(bodID, receivedBodXml); AddTraceLog("Inbound BOD archived with ID: " + bodID); // Process the BOD ProcessBODData(receivedBodXml); }