In this section we describe how to create a delivery. A delivery is required to interact with the facts stored in the i-refactory.
Deliveries always point to one certain Layer. The following type of deliveries are supported:
There are two ways to create a delivery. In most cases the delivery is created with an API. For developmental purposes, it is also possible to create and process a delivery manually:
Deliveries trigger the activities to process incoming or outgoing data-exchange. In this section we explain how to configure each type of delivery.
Click on the Menu > Supply > Delivery
.
Select the Layer for which you want to create a Delivery and then press New
.
In the form that appears you are required to assign a Delivery Agreement
. The delivery will inherit the relevant metadata of the Delivery Agreement, Layer, Interface and Entities.
Optionally you can enter you own reference number in Message Number
or other reference details in Message Text
.
Dependent on the Layer for which you create Delivery, you can fill in further details. Next paragraphs explain how to configure each type of delivery in the form that appears.
Don't forget to save the delivery once you completed the configuration settings for the delivery.
Choose the Received Date
. Submit the date on which the delivery was actually received.
{warning} The
Received Date
you enter must always be later than theReceived Date
of previous deliveries.
Optionally choose a Sent Date
. Submit the date on which delivery was actually sent.
Choose what level of Constraint Validation
needs to be executed. If you want to cancel the selection, click on No selection
.
None
: executes minimum technical prerequisite. The checks are fully based on database processing and are not part of the validation process. If you select this option and there are data errors, this may result in a database error or an other technical error that breaks the processing of the delivery.All
: all constraints are checked during the validation proces.Default
: all delivery agreements constraints in the default
group are checked during the validation process.Mandatory
: constraints that are inherent (mandatory) to the structure of a data model are checked during the validation process. The mandatory constraints to check are:
alternate key
{tip} A good practice is to chose the validation level
Mandatory
as a minimum option, since this controls minimum set of validations when loading data into the Central Facts Layer in a controlled manner.
Violated Constraint Max Sample Size
: maximum sample size of violated constraints that are logged. By default, this is 1000. A lower sample size can improve the throughput of the validation process and lowers the storage cost in case of a high volume of constraint violations. Sample size value is per constraint. So for each constraint a maximum of sample size records will be registered, including the record on which the constraint violated.
For delivery's on the Logical Validation Layer you can override the inherited includeExistingDataForSkippedRowsInSetValidation value from Delivery Agreement. includeExistingDataForSkippedRowsInSetValidationConclusion shows the computed value for this Delivery.
This setting prompts the user to decide whether to include rows that there rejected for basic constraints in previous deliveries by default the i-refactory tries to fetch the known data of these rejected rows from previous deliveries. This data is then used to perform set validations on rows in the current delivery that did not get rejected.
The table below shows how includeExistingDataForSkippedRowsInSetValidationConclusion
is computed for a Delivery.
Delivery value | Delivery Agreement value | Delivery Conclusion |
---|---|---|
DEFAULT | YES | YES |
DEFAULT | NO | NO |
YES | NO | YES |
NO | YES | NO |
Context Related Entities Contain New Rows
(for context-based deliveries): select this option if you are sure the context-related entities contain only new records. If this option is selected, i-refactory handles the delivery as a full delivery for every entity the context filter is set to True.
{info} Selecting
Context Related Entities Contain New Rows
results in a quicker writing proces, because no difference is computed between a full and delta delivery set. The delivery won't delete any data, only save and update.
The i-Refactory has built in logic to identify deleted records (records that do no longer exist).
For entities that are provided as full
, all records that already exist but are no longer available are considered 'relevant for deletion'. For entities delivered as delta
, the deletion indicator provided in the record will indicate 'relevant for deletion'.
The delete type
indicator affects how deletions are handled.
Deletes
in the dataset will be treated. Click here for more information about removing records and the differences between logical deletes and physical deletes.
Logical
: the deleted records will be end-dated and flagged as deleted in the CFL. The logical deleted records are shown in the 'hist' views in the GDAL but not shown in the 'current view'. By default, this option is selected. More information can be found here.Physical
: the context information of the deleted records is physically removed from the Logical Validation Layer. In the Central Fact Layer, the Context data of the records will be physically deleted and the relevant key in the Anchor will be marked as physically removed. More information can be found here.In the 'Delivered entities' section, you can select which entities will be delivered and submit their snapshot date.
The following delivery loading strategies are available:
Complete
Delivery.Partial
Delivery.Full
Delivery of the related Entity.
Delta
Delivery of the related Entity.
Context Based Delivery
, you need to classify a foreign key relation between entities in your data model as use as context filter and select the driving entity as Delta
and the dependent entity as Full
.To customize the options:
Entities
are included in the delivery. You can unselect the checkbox to exclude entities, for example, for partial deliveries.Entities
are marked as Complete
. Unselect the checkbox to mark the entity as a delta delivery.Optionally set a Snapshot datetime
per entity. The Snapshot datetime
will be used as transaction datetime when registering facts in the Central Facts Layer. If you do not enter a specific Snapshot datetime, the transaction time will set to the system datetime of the i-refactory server.
{info} When to use Snapshot Datetime:
If you want strict control over the transaction timelines that manage the validity window of the provided records, you have the option to override the default behaviour of using the server datetime as the timestamp that opens new records and enddate deleted or updated records.
Use cases to do this is to align the target system managed by i-Refactory with the data validity timelines of the source system or even the source system entity. Another use could be to load historical datawarehouse data into the system managed by i-refactory and keep the already existing timelines available.
In all cases the snapshot datetime for a delivered entity must be after the last provided snapshot datetime.
ExampleSuppose there is already a delivery at Time 1 and a delivery at Time 3.You want to add a delivery at transaction Time 2. You cannot submit Time 2 as
Received Date
becauseReceived Date
needs to be later than Time 3 (this delivery is already in the database). However, you can enter Time 2 asSnapshot Datetime
and thetransaction datetime
in the database will correspond to Time 2.
Physical Deletes allowed
when you want to allow delete actions result in physical removal as part of the CRUD transaction.After saving this delivery, the i-refactory engine will directly activate the required processes after which it will be possible to insert
, update
, and delete
the facts for the entities in the given Generic Data Access model. The Generic Data Access delivery will be active until stopped.
{info} If a delivery to the Logical Validation Layer (LVL) for the same Central Facts Layer is running, the GDAL Delivery will be blocked and only released when the LVL delivery has reached an end-state.
Enter the details of the request into Export Specification as a JSON. Use Display Schema to learn about all the options you have.
This example shows you an example a JSON based Export Specification:
{
"snapshotDatetime": "2023-09-26 10:43:14.0430000",
"localFileSystem": {
"rootPath": "/Users/tester/tmp/"
},
"filterParameters": [
{
"columnCode": "dataProducerName",
"columnValue": "RAB"
},
{
"columnCode": "deliveryId",
"columnValue": "1000"
}
],
"customMetadata": {
"obligation": 1096531987,
"modelCode": "TPCH",
"modelVersion": "1.0.4",
}
}
At least you provide:
{info} filterParameters are case sensitive. By providing only columnCodes (and not the combination of entityCode/columnCode) the system automatically uses matching columns from all entities within the File Export interface as a filter.
As part of the export, the rootPath is extended with the following path: /export-<export delivery id>/schema code>/<entity code>/
. The exported files are named <entity code>.parquet
. By default all files are exported as parquet ( more information can be found here ).
For each delivery, a manifest file will be placed in /export-<export delivery id>/
and is named exportDelivery.json
. The manifest file includes the following:
deliveryId of the export
receivedate of the export-delivery API call
the used FILE EXPORT interface
the Export Specification as defined in the delivery request
a list of details for each entity exported:
namespace_id | namespace_code | entity_id | entity_code | rowcount_method | rowcount | message_nbr | message_text |
---|---|---|---|---|---|---|---|
47 | tpch | 19 | order | Approximate | 2000 | ||
47 | tpch | 22 | order_lines | Approximate | 8005 |
Messages are used to communicate warnings when attribute values are restricted in length. For example, when undefined varchar(max) datatypes are used.
For testing purposes you can process a delivery by manually switching the state transitions. This simulates API processing of external deliveries.
menu > Supply > Delivery
.Technical Staging Entity Updates
. PROCESSING
first, before you can switch to SUCCEEDED
.PROCESSING
first, before you can switch to FAILED
.PROCESSING
and press Apply to all selected rows. SUCCEEDED
and press Apply to all selected rows.menu > Supply > Monitor
, you can see the delivery process in the monitor.menu > Supply > Delivery Statistics
, you can analyze the delivery statistics.FAILED
and press Apply to all selected rows.menu > Supply > Monitor
, you can see the failed delivery in the monitor. {warning} Cancelling Deliveries could lead to an unwanted intermediate state of your data if the cancel happens after the Technical Staging Layer (TSL). A cancel is not a rollback to a previous state. If you cancel the current Delivery, the processed and successful entity updates in these delivery are stored in the Central Facts Layer, while the idle and scheduled tasks are stopped.
{info} i-refactory assumes that you have (manually) filled the associated tables in the TSL, as this is not part of the i-refactory application.
You can find the API documentation on: <hostname>:3001
. For example: https://localhost:3001/
Example json-configuration for creating a delivery to the Logical Validation Layer where only orders and orderlines are expected to be processed using the CSV-loader option:
{
"architectureLayerCode": "HSTGIN",
"interfaceCode": "TPC_H_HSTGIN",
"tenantCode": "TPCH",
"receivedDt": "2022-01-02T00:00:01",
"sentDt": "2022-01-01T12:00:00",
"snapshotDt": "2022-01-01T00:00:00",
"isComplete": true,
"constraintsToValidate": "ALL",
"violatedConstraintMaxSampleSize": 50,
"logicalValidationDeliveryDeleteType": "LOGICAL",
"deliveredEntity": [
{
"namespaceCode": "tpc_h",
"entityCode": "order",
"isComplete": false
},
{
"namespaceCode": "tpc_h",
"entityCode": "order_line_item",
"isComplete": true
}
],
"csvLoaderSpecification": {
"uncPath": "//Mac/home/i-refact-demo-tpch/deliveredData/orderSystem/delivery-report-load",
"codePage": "raw",
"fieldTerminator": "|",
"firstRowIsHeader": false,
"fileExtension": "tbl"
}
}
A delivery from the File Export Layer can be called using this example.
{
"architectureLayerCode": "FILE_EXPORT",
"interfaceCode": "TPC-H GDAL",
"tenantCode": "TPCH",
"exportSpecification":
{
"snapshotDatetime": "2023-09-26 10:43:14.0430000",
"localFileSystem": {
"rootPath": "/Users/tester/tmp/"
},
"filterParameters": [
{
"columnCode": "dataProducerName",
"columnValue": "RABO"
},
{
"columnCode": "deliveryId",
"columnValue": "1000"
}
],
"customMetadata": {
"obligation": 1096531987,
"modelCode": "TPCH",
"modelVersion": "1.0.4"
}
}
}
Similar to the valid timeline, a transaction timeline consists of a start date
and end date
.
It is the period during which a fact is valid in the system.
In the i-refactory the transaction time is tracked with acm_start_dt
and acm_end_date
.
The transaction time in i-refactory is different from what is commonly understood by transaction time. Transaction time is usually seen as the moment when a fact was stored in the database. In i-refactory the transaction time is as dictated by the source system, not by the i-refactory database.
The delivery tenant can specify with the snap_shot_date what the transaction start date (acm_start_dt
) has to be.
{warning} The transaction start date of a new delivery has to be later than the transaction start dates of earlier deliveries.