We can encounter several failures while importing content/data in Asta7. So far , our approach for handling failures has been to throw an exception and abort the import. However, But this approach is not user-friendly , as most of the failures are recoverable.
...
Table of Contents | ||
---|---|---|
|
Conflicts
The conflicts can be divided into several categories. They are as follows
UNIQUE
Most of the conflicts can be put into this category. This conflict can happen for fields in entities that are marked as UNIQUE. In most cases, this conflict will happen if you try to import an already existing object. An entity can have the following types of unique fields
AMID
Every entity implicitly has a system field called AMID (_amid
). This field uniquely identifies an object of a particular entity and project. This field is of type UUID.
Primary Keys
Every entity should have one or more user-defined unique identifiers as well. These fields are marked as primary keys in the entity. These fields can be of any type.
Info |
---|
We are considering a single primary key for now |
Unique
Entities can have other fields as well which are marked as unique by the user. These can be of any type as well.
FVP Unique
Root entity fields that have a Field Value Pattern
associated with them are considered UNIQUE as well.
...
Type | Description | Solutions | Example |
---|---|---|---|
UNIQUE |
|
| There is an object of entity A with AMID |
...
When trying to import this object again or any other object of entity A with the same AMID |
...
. There is an entity A which has a field |
...
When trying to import any object of entity A with the identifier |
...
. |
Solutions
GENERATE
SET_BY_USER
SET_NULL
FAIL
FK
...
FK |
|
...
...
|
...
| Entity A has a sub-entity Entity B. Entity B then will have a field like |
...
When trying to import an object of Entity B which has a value in the |
...
. |
Solutions
SET_NULL
FAIL
REQUIRED
...
REQUIRED |
|
...
|
| Entity A has a primary key field |
...
When the import file for entity A contains an object which has no value set for the field |
...
. |
...
TYPE
Each field in an entity has a type (UUID, TEXT, etc.). If the provided value type of a field in the import does not match the field type then this conflict will happen.
Example
TYPE |
|
|
...
FAIL
| Entity A has a field |
...
When the import file for entity A contains any value for the field |
...
. |
...
Solutions
...
LENGTH |
|
|
LENGTH
VARCHAR fields can have an optional length
property set. This property dictates how long the text value can be. If any value exceeds the length
then this conflict will happen.
Example
Entity A has a |
...
When the import file for entity A contains any value for the field |
...
. |
...
Solutions
...
TRIM_EXTRA
...
...
SET_NULL
...
FAIL
Root System Entity UNIQUE |
...
|
...
| The system already has an AKTOR with |
...
When trying to import any data that has an AKTOR with |
...
. |
...
Solutions
...
IGNORE
...
Solutions
Type | Description | Challenges |
---|---|---|
GENERATE |
|
|
SET_BY_USER |
|
|
SET_NULL |
| |
SET_NULL_OR_REGENERATE |
| |
TRIM_EXTRA |
| |
IGNORE |
|
|
REPLACE_WITH_EXISTING |
|
|
FAIL |
|
...
Support Excel import
Support Composite PK Support and FK conflict
Generate other types than UUID
Optimize using temporary table and/or files rather than the memory
Add more types of solutions