Skip to content

Delivery Process

This section explains the status transitions relevant for delivery processing. Understanding the status transitions is a prerequisite to effectively use the Delivery Monitor and Delivery Analyze functionality.

Which statuses are managed?

Processing a delivery will lead to status transitions on each of the following levels:

Delivery: all possible statuses

Delivery Status Description End state for the delivery?
ACCEPTED Delivery is accepted when the data is available in the HSTGIN and ready to be loaded to the CFPL No
BLOCKED CRUD Interface is blocked when a batch is started No
CANCELLED The delivery is cancelled by the operator. This can happen in every step when an entity update is FAILED Yes
CANCELLING Graceful ending of all running tasks before Delivery is set to Cancelled No
LOADED Data is available in TSTGIN No
PERSISTED Data load to the CFPL is finished Yes
PERSISTED WITH VIOLATED CONSTRAINTS Data load to the CFPL is finished and violated constraints exist that did not exceed the threshold value Yes
PERSISTING Data load from the GDAL to the CFPL is possible only for GDAL deliveries No
RECEIVED Delivery is created No
REFUSED Data validation failed, the constraint threshold was exceeded for at least one item Yes
REJECTED Delivery is rejected Yes
VALIDATED The data validation succeeded, data can be loaded to the HSTGIN No
EXPORTED The file-export is completed (only for export deliveries) Yes

Interface: the status of a load to an interface in the delivery

Interface Status Description
PROCESSING The interface is currently updating
IDLE The interface is marked for processing but is waiting for an available slot or waiting for the previous layer to be finished
COMPLETED The updating of the interface succeeded
Entity Status Description
FAILED Entity update failed
IDLE The entity is marked for processing but is waiting for an available slot or waiting for dependent updates
PROCESSING Entity is currently being updated
SCHEDULED The entity is marked for processing
SUCCEEDED Entity update succeeded

State Transitions for an external delivery to a Logical Validation Layer

stateDiagram-v2
    classDef notMoving fill:white,stroke:grey

    [*] --> Received : New delivery
    Received --> Rejected : Reject delivery
    Rejected --> [*] : End state reached
    Received --> Loaded : Technical staging successfully loaded
    Validated --> Refused : Error threshold exceeded
    Refused --> [*] : End state reached
    Loaded --> Validated : Validation completed
    Validated --> Accepted : Validation successfully loaded
    Accepted --> Persisted : Central facts loaded
    Loaded --> Cancelling
    Validated --> Cancelling
    Accepted --> Cancelling
    Cancelling --> Cancelled
    Cancelled --> [*] : End state reached
    Persisted --> [*] : End state reached

    class Rejected notMoving
    class Refused notMoving
    class Persisted notMoving
    class Cancelled notMoving
  • Only the Received state in the technical staging can be Rejected.
  • When the technical staging is successfully processed the delivery status goes to Loaded.
  • When the data is successfully validated the status goes to Validated.
  • If there are errors in the validation (there are more errors than defined in the threshold), status goes to Refused.
  • When the logical validation layer is successfully processed the delivery status goes to Accepted.
  • When the delivered entities are successfully processed into the Central Fact Repository Layer, the Delivery status goes to Persisted which is the end state.
  • Cancelled can be relevant for every step that is not an end-state.

State Transitions for a CRUD delivery to a Generic Data Access Layer

State Transitions for Delivery

stateDiagram-v2
    classDef notMoving fill:white,stroke:grey

    [*] --> Persisting : New Delivery
    [*] --> Blocked : New Delivery
    Persisting --> Persisted
    Blocked --> Persisting 
    Persisting --> Blocked
    Persisted --> [*] : End state reached

    class Persisted notMoving      
  • The delivery status goes directly to Persisting.
  • If there is an overlapping delivery on the Logical Validation Layer (overlapping entities in the interface that are related to the same facts as registered in the Central Fact Persistency Layer), the GDAL delivery is Blocked until the processing of the Logical Validation Layer is completed.
  • When the GDAL delivery is stopped the status goes to Persisted.

State Transitions for an Export Delivery

stateDiagram-v2
    classDef notMoving fill:white,stroke:grey

    [*] --> Received : Delivery created
    Received --> Cancelling : When Cancel button used
    Cancelling --> Cancelled ::: notMoving : Graceful ending of running tasks
    Received --> Exported ::: notMoving : all tasks successfully completed
    Exported --> [*] : End state reached
    Cancelled --> [*] : End state reached

    class Exported notMoving
    class Cancelled notMoving   

State Transitions for Interface

stateDiagram-v2
    classDef notMoving fill:white,stroke:grey

    [*] --> Idle : New Delivery
    Idle --> Processing : EntityUpdate set to processing
    Processing --> Completed ::: notMoving : All EntityUpdates succeeded
    Completed --> [*] : End state reached

    class Completed notMoving

State Transitions for Entity

stateDiagram-v2
    classDef notMoving fill:white,stroke:grey

    [*] --> Idle : New Delivery
    Idle --> Scheduled : Dependent predecessor entityUpdates succeeded
    Scheduled --> Processing : Processing slot available
    Processing --> Failed : Error
    Failed --> Scheduled : Retry
    Processing --> Completed  ::: notMoving : Data loaded
    Completed --> [*] : End state reached

    class Completed notMoving
  • Once a delivery is created the status of entities is automatically set to Idle.
  • If all dependencies that are required to load the entity are met, then the entity is set to Scheduled.
  • Once a processing slot becomes available the entity is set to Processing.
  • If the data is successfully loaded the entity goes to Processing.
  • If there's an error the status goes to Failed.
  • When Retrying the entity update the status goes directly to Scheduled.

Design Rules

  1. A new Delivery for the same Interface can be delivered after completion of the previous Delivery with status as an end-state.
  2. A Delivery can be set to REJECTED if the load of data to the Technical Staging fails.
  3. If an Entity update fails to the Logical Validation Layer or the Central Fact Persistency Layer, the data has to be corrected and the delivery has to be retried. This is because there is no roll back mechanism in place to roll back a partial load to layers after the Technical Staging. The status Accepted is then still applicable. One cannot import a new version of the models until the status is changed to an end state.

Info

If you forget to import your new model but do start a Delivery, the Delivery will 'hang' on the last table. It will keep communicating it is running, but it is not. Only way to fix this is to change the Accepted status to a Failed status manually with sql.

APIs

Interacting with the i-refactory is based on API services. For Deliveries the following APIs are available ( example scripts can be found in i-refactory-engine\example\restful\ ) :

API Example script Description
acmDatalog.activeLogicalStaging DeliveryEntityUpdateFromExternalSource handleTechnicalStagingLoad.js Determine all entity updates for a delivery and set the entity updates to Succeeded
acmDatalog.activeDeliveryEntityUpdate handleTechnicalStagingLoad.js Determine all entity updates for a delivery and set the entity updates to Succeeded
acmDatalog.activeDeliveryEntityUpdate getActiveDeliveryEntityUpdateInfo.js Get the states for all entity updates for a delivery
acmDatadel.activeDelivery getActiveDeliveryInfo.js Get all active deliveries

What's next?