Order Archive agent

The Order Archive time-triggered transaction archives purged orders from Sterling™ Order Management System Software to Archive Service. After archiving the purged orders, the Order Archive time-triggered transaction also deletes the purged orders from Sterling Order Management System Software.
The Order Archive agent obtains and processes the awaiting archive records from the OSI_AWAITING_ARCHIVE table when the following conditions are satisfied:
  • ENTITY_NAME is ORDER_HEADER, which is the entity name of Order entity.
  • ARCHIVE_ON_DATE is less than the current date.
  • LAST_FAILED_DATE is null or 30 days before the current date.
  • ENTERPRISE_CODE matches the agent criteria.
  • ARCHIVED_DATE is null.
All orders that are staged and ready to be archived on the specified date are picked up for archival by the Order Archive agent.
Before you run the Order Archive time-triggered transaction, complete the following steps:
  • Configure the osi.order.service.url property to connect to Archive Service.
  • Configure the osi.archive.enabled property to enable the integration with Archive Service.
  • Configure the history order retention days for each document type to define the retention period for history orders in Sterling Order Management System Software.
  • Orders are purged and moved to history tables and a record is inserted in the OSI_AWAITING_ARCHIVE table with the EntityName=Order_Header, EntityKey=<value of OrderHeaderKey> and ArchiveOnDate=<Calculated using Order Purge Date and Order History retention days and additional purge criteria >. For more information about the Order Purge agent, see Order purge.
The Order Archive time‑triggered transaction supports Delayed Deletion. This feature allows you to postpone the deletion of purged orders from Sterling Order Management System Software after the orders are archived. This feature operates as a two-step process:
  1. Archive orders

    The Order Archive agent archives purged orders from Sterling Order Management System Software to the Archive Service by setting the criteria parameter Mode=Archive.

    The system stamps an ArchivedDate on each archived order

  2. Delete Archived Orders

    In a subsequent run, the Order Archive agent deletes previously archived orders by setting the criteria parameter Mode=Delete. Deletion occurs only after the configured delay period specified in the osi.archive.delayDeletion.days runtime property.

For example, the Order Archive agent runs in Mode=Archive and order ORD1 is archived on 10‑Jan‑2025. During the archive process, the system stamps the order with ArchivedDate = 2025/01/10. Assume, the runtime property osi.archive.delayDeletion.days is set to 3. If the agent runs in Mode=Delete on 14‑Jan‑2025 or later, then ORD1 becomes eligible for deletion, according to following conditions:
  • ArchivedDate < (Current_Date – osi.archive.delayDeletion.days)
  • Validation:

    2025/01/10 < (2025/01/14 - 3)

    2025/01/10 < 2025/01/11 ✓ Condition met

Attributes

The following table describes the attributes for this time-triggered transaction:
Attribute Value
Base Transaction ID OSI_ORDER_ARCHIVE
Base Document Type GENERAL
Base Process Type GENERAL
Abstract Transaction None
APIs called archiveOrder API

This API is available in Archive Service, which is used for archiving an order and related entities to Archive Service.

User Exits called
  • OSIGetExternalOrderArchiveInputUE
  • OSIGetExternalOrderLineArchiveInputUE
  • OSIArchiveSuccessExternalActionUE

Criteria parameters

The following table describes the criteria parameters for this time-triggered transaction:
Parameter Description
Action This parameter triggers the transaction. The default value is "Get".
Number of records to buffer Optional. Indicates the number of records to retrieve and process at one time. If left blank or specified as 0 (zero), it defaults to 5000.
EnterpriseCode Optional. Enterprise for which the Order Archive agent needs to be run. If not passed, all enterprises are monitored.
Colony Id If the colony ID is passed without the enterprise code, the agent is triggered for all enterprises that are configured in that colony.
Collect Pending Jobs This agent does not provide the pending jobs count for monitoring it in the System Management Console. Hence, this parameter is set to N and cannot be modified.
Mode This parameter specifies how the Order Archive time‑triggered transaction deletes orders from Sterling Order Management System Software, once these orders are archived to the Archive Service. Supported values are blank, archive, and delete.

The default mode value is blank

Note:

Default mode and Archive/Delete modes are mutually inclusive and must not be used together.

Either use Mode as blank to archive the order to the Archive Service and delete it from Sterling Order Management System Software immediately or use the two-step delayed deletion approach by running Mode='Archive' to archive the purge order and then Mode='Delete' to delete the archived order from Order Management System after the delay configured by osi.archive.delayDeletion.days.

Statistics tracked

The following table describes the statistics that are tracked for this time-triggered transaction:
Statistic Name Description
NumberOfOrdersArchived Number of history orders archived.
NumberOfOrderArchiveFailures Number of failures occurred during archival.

Pending job count

None.

Events raised

The following events are raised by this time-triggered transaction:
Transaction/Event Data Published Template Support
ON_FAILURE OSI_ORDER_ARCHIVE.ON_FAILURE.xml Yes

Tables archived

The Order Archive agent archives the following tables:
  • YFS_ADDNL_LINE_PRICE_H
  • YFS_ANSWER_SET_TRAN_H
  • YFS_ANSWER_TRAN_H
  • YFS_CHARGE_BREAKUP_H
  • YFS_CHARGE_TRAN_DIST_H
  • YFS_CHARGE_TRAN_REQUEST_H
  • YFS_CHARGE_TRAN_RQ_MAP_H
  • YFS_CHARGE_TRANSACTION_H
  • YFS_CREDIT_CARD_TRANSACTION_H
  • YFS_ENTITY_ADDRESS_H
  • YFS_HEADER_CHARGES_H
  • YFS_INSTRUCTION_DETAIL_H
  • YFS_INVOICE_COLLECTION_H
  • YFS_NOTES_H
  • YFS_ORDER_APPROVAL_H
  • YFS_ORDER_APPROVAL_DTL_H
  • YFS_ORDER_AUDIT_H
  • YFS_ORDER_AUDIT_DETAIL_H
  • YFS_ORDER_AUDIT_LEVEL_H
  • YFS_ORDER_DATE_H
  • YFS_ORDER_HEADER_EXTENSION_H
  • YFS_ORDER_HOLD_TYPE_H
  • YFS_ORDER_HOLD_TYPE_LOG_H
  • YFS_ORDER_INVOICE_H
  • YFS_ORDER_INVOICE_DETAIL_H
  • YFS_ORDER_LINE_RELATIONSHIP_H
  • YFS_ORDER_LINE_REQ_TAG_H
  • YFS_ORDER_OVERRIDE_H
  • YFS_ORDER_PROD_SER_ASSOC_H
  • YFS_ORDER_RELEASE_H
  • YFS_ORDER_SEARCH_CONDITION_H
  • YFS_ORDER_TAG_H
  • YFS_PAYMENT_H
  • YFS_PMNT_TRANS_ERROR_H
  • YFS_PROM_AWARD_REF_MAP_H
  • YFS_PROMOTION_H
  • YFS_PROMOTION_AWARD_H
  • YFS_PROMOTION_REFERENCE_H
  • YFS_RECEIVING_DISCR_DTL_H
  • YFS_RECEIVING_DISCREPANCY_H
  • YFS_REFERENCE_TABLE_H
  • YFS_STOP_DEL_REQ_DTL_H
  • YFS_STOP_DEL_REQ_HDR_H
  • YFS_TAX_BREAKUP_H
  • YFS_TRANSACTIONAL_RELATION_H
  • YFS_LINE_CHARGES_H
  • YFS_ORDER_KIT_LINE_H
  • YFS_ORDER_KIT_LINE_SCHEDULE_H
  • YFS_ORDER_LINE_EXTENSION_H
  • YFS_ORDER_LINE_H
  • YFS_ORDER_LINE_OPTION_EXTN_H
  • YFS_ORDER_LINE_OPTION_H
  • YFS_ORDER_LINE_RELATIONSHIP_H
  • YFS_ORDER_LINE_SCHEDULE_H
  • YFS_ORDER_LINE_SRC_CNTRL_H
  • YFS_ORDER_RELEASE_STATUS_H
  • YFS_ORDER_SER_PROD_ITEM_H
  • YFS_ORDER_HEADER_H
  • YFS_ORDER_LINE_PRICE_MATCH_H
  • YIC_BOM_LINE_H
  • YIC_BOM_HEADER_H
  • YIC_BOM_MESSAGE_H
  • YIC_BOM_PROP_H
Note: Currently, you cannot archive the following tables by using the Order Archive agent:
  • PLT_FILE_ATTACHMENT_H
  • PLT_FILE_DATA_H