Data Versioning Sample App

Content Type: Sample
Categories: User Interface,Data


This Data Versioning Sample App has been constructured on top of the Purchase Request Starter Template, to show off some of the data versioning possibilities in Mendix. Using inheritance, Entity Dataversioning.History allows you to create, commit, retrieve and maintain chained versions of Objects. This is a template meant to inspire and teach about the Data and UX aspects of versioning. It is not production ready.


After having downloaded the project, start it up and either open the $Product overview (Backwards versioning), or the $CarDesign view (Up Front). These terms are clearly elaborated right here in the recording of the Mendix Meet up that was held on this topic in Nieuwgein, Utrecht.


If you want to use this template for your own application, I suggest you:

-Clear the DataVersioning module of the example $CarDesign, $FuelType, $Option, and $Color entities, as well as the folder called "CarDesign_Entities;" 

-Clean ENUM_History_InstanceType to only contain a list of your chosen specializations (remove CarDesign, Request and Product)

-Export the DataVersioning module and reimport in a new Mendix app. 

-Delete the WriteAccess Module Access Role and redo any security-related work.

-Clean up any remaining errors


If you have any questions, feel free to reach out to me at LinkedIn


Typical usage scenario

Use when you want to start to learn how to implement chain versioning in your Mendix app; versioning in this module has been implemented to allow you to show coherent/intact versions of entities, displayed side by side. 


Features and limitations

-Make entities versionable by inheritance via DataVersioning.History

-Do association and db retrieves of the previous/next version over a self-reference in $History, which is inherited by any specialization

-Save versionings Up Front, or Backwards in the version chain. Examples of both options are given in this module. 

-Scrolling in one version is mirrored in the other version pop-ups, allowing easy comparison

-Multiple versions can be easily closed with a single close button 



Unpack and run to see how it works; as admin, there are two entity screens that will allow you to try out both versions run time. I suggest you put a breakpoint in BCO_History_VersionIfNeeded_Backwards and in ACT_History_Save. Inspect the differences between both types of versioning (Backwards/Up Front) when creating/saving versions. Mind that backwards versioning of $Product will only take place if it has been used in a $ProductLine (create a request with the product)



Version: 1.0.0
Framework Version: 10.9.0
Release Notes: Please see main description; This sample app contains a module which allows you to version any persistable entities in a chain, by making those entities a specialisation of DataVersioning.History. It also offers a selection of handy tools to present these versions in the Mendix UI, side by side.