Table life cycle
What you will learn
How to archive elements in the schema definition of a table.
Deleting data vs archiving data
Deleting the wrong data can have a huge impact on your business.
For example imagine that you have a Products table, you want to delete one of the categories that is not used anymore. So you delete the Category and at this time:
- All of your users that have used this Category on products in the past view their data "disappear" on each product concerned.
- If you are collecting data from suppliers, they also experience the lost of data they entered.
- If you have Fields specific to categories all data have also been lost.
But oops you just deleted the wrong Category. How to rollback?
If the data would have been deleted, you should have a technical rollback, which mean stop your users and partners from using the application during several days.
This is the reason why in Product-Live you cannot delete data on the schema of a table, you can only archive some elements.
To get a concrete example imagine that you have this data structure, with these categories:
Then you archive the Category Laptop, you will have this result for users:
As you can see the value laptop is still visible, but there is a symbol that indicates that there is a problem. If the user clicks on the value he will see:
Therefore users do not see their values "disappear".
Archived values can also be filtrable:
If you have set conditional formatting rules, the value is considered empty. Therefore if the value is required, then an archived Category will flag an error:
Now if you rollback setting the Category to active, then:
- All the values that have been set for this Category will get back again
- All conditional formatting rules will be applied again
No need for complex rollback!
Life cycle of each core elements
Levels
Levels cannot be archived, but in practice you can add new levels even it is not a best practice.
You must never add a level on a table that is in production.
Partitions
Partitions cannot be archived. If you don't need a partition, just don't use it.
Identifiers
Identifiers can be archived.
How to archive an Identifier?
If you are using the task Import Table Schema, in mode EXHAUSTIVE
just remove the existing Identifier from the xml file, in mode INCREMENTAL
you must explicitly define that the Identifier must be archived:
xml
<Identifiers>
<Identifier key="EAN" index="1" level="product" status="ARCHIVED" />
</Identifiers>
1
2
3
2
3
What is the impact on the frontend?
Archived Identifiers can still be used in Screens.
What is the impact on the task Export Items?
Archived Identifiers are not exported.
What is the impact on conditional formatting?
Rules on archived Identifiers are ignored during the calculus of the conditional formatting.
How to reactivate an archived Identifier?
Just declare the Identifier again.
xml
<Identifiers>
<Identifier key="EAN" index="1" level="product" />
</Identifiers>
1
2
3
2
3
Classifications
Classifications can be archive.
How to archive a Classification?
If you are using the task Import Table Schema, in mode EXHAUSTIVE
just remove the existing Classification from the xml file, in mode INCREMENTAL
you must explicitly define that the Classification must be archived:
xml
<Classifications>
<Classification key="TYPOLOGY" status="ARCHIVED" />
</Classifications>
1
2
3
2
3
What is the impact on the frontend?
Archived Classifications can still be used in Screens.
What is the impact on the task Export Items?
Archived Classifications are not exported.
What is the impact on conditional formatting?
- Rules on archived Classifications are ignored during the calculus of the conditional formatting.
- Rules on Fields specific to categories of an archived Classification are also ignored.
How to reactivate an archived Classification?
Just declare the Classification again.
xml
<Classifications>
<Classification key="TYPOLOGY">
<Title>Typology</Title>
</Classification>
</Classifications>
1
2
3
4
5
2
3
4
5
Categories on Classifications
Categories can be archived.
How to archive a Category?
If you are using the task Import Table Schema, in mode EXHAUSTIVE
just remove the existing Categories from the xml file, in mode INCREMENTAL
you must explicitly define that the Category must be archived:
xml
<Classifications>
<Classification key="TYPOLOGY">
<Title>Typology</Title>
<Categories>
<Category key="LAPTOP" status="ARCHIVED">
<Title>Laptop</Title>
</Category>
</Categories>
</Classification>
</Classifications>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
What is the impact on the frontend?
Archived categories are still visible in the frontend.
What is the impact on the task Export Items?
Archived categories are not exported.
What is the impact on Conditional Formatting?
- Archived categories are considered as empty value during the calculus of the conditional formatting rules.
- Rules on Fields specific to archived categories are ignored.
How to reactivate an archived Category?
Just declare the Category again.
xml
<Classifications>
<Classification key="TYPOLOGY">
<Title>Typology</Title>
<Categories>
<Category key="LAPTOP">
<Title>Laptop</Title>
</Category>
</Categories>
</Classification>
</Classifications>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Fields
Fields cannot be archived. The reason is that a Field can be common or specific, and if it is specific you should want to archive the relation with a Category but still keep the relation with other categories.
That's why archiving Fields is done in Matrix.
Options on select Fields
For Fields with type:
- SINGLE-SELECT
- MULTIPLE-SELECT
- MULTIPLE-SELECT-QUANTIFIED
- MULTIPLE-SELECT-QUANTIFIED-WITH-COMMENTS
Each Options can be archived.
How to archive an Option?
If you are using the task Import Table Schema, in mode EXHAUSTIVE
just remove the existing Options from the xml file, in mode INCREMENTAL
you must explicitly define that the Option must be archived:
xml
<Fields>
<Field key="COLOR">
<Title>Color</Title>
<Options>
<Option key="RED" status="ARCHIVED">
<Title>Red</Title>
</Option>
</Options>
</Field>
</Fields>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Impact on the frontend
Archived Options can still be visible, like archived categories.
Impact on export items
Archived Options are not exported.
Impact on conditional formatting
An archived Option is considered as an empty value during the calculus of the conditional formatting rules.
How to reactivate an archived Option?
Just declare the Option again.
xml
<Fields>
<Field key="COLOR">
<Title>Color</Title>
<Options>
<Option key="RED">
<Title>Red</Title>
</Option>
</Options>
</Field>
</Fields>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Matrix
You can archive links defined in common or specific.
How to archive a link?
If you are using the task Import Table Schema, in mode EXHAUSTIVE
just remove the existing link from the xml file, in mode INCREMENTAL
you must explicitly define that the link must be archived:
xml
<Matrix>
<Common>
<Field key="DESCRIPTION_FR" status="ARCHIVED" />
<Common>
<Specific classification="TYPOLOGY" category="LAPTOP">
<Field key="STORAGE" status="ARCHIVED" />
</Specific>
</Matrix>
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Impact on the frontend
The visibility of a Field is defined by the screen. Therefore if a link is archived, it is still visible for users if the field is always visible in the screen. For example archiving the link with DESCRIPTION_FR Field, and still using it in the Screen, will result to:
Impact on export items
Values of archived link are not exported.
Conditional formatting
Values of archived links are considered as empty values during the calculus of the conditional formatting rules.
Sections
Sections cannot be archived.
Screens
Screens can be archived like this:
xml
<Screen key="ALL_PROPERTIES" level="PRODUCT" status="ARCHIVED" />
1
To reactivate a screen, just send back the whole screen definition.
Columns on Screens
The Screen definition is always exhaustive, which means that if you want to remove one or many column on a screen, you must send the whole new screen definition.