Friday 21 August 2015

Versions (Master Data Services) - Where to use


Multiple versions of the master data within a model can be created in Master Data Services(MDS). When you create a model for the first time, Master Data Services (MDS) creates a default initial version of the model data.

While working with MDS, I was trying to find when to use Versions. I have googled it and I didn’t find sufficient answer, so I tried few things from my side. I have considered that I already have a model called Product which is developed and moved to Production after testing it very well. Now I want to use the Versions feature supported by MDS. So question is where it will fit in or what could be the best case to use it?

Before getting into details of scenario let us know little bit about Versions. We can create sequential or simultaneous versions of our model in MDS.

Sequential Versions  - Version can be created one after another in sequence manner. For example, you can copy Version 1 of your model and name the copy Version 2.

Simultaneous versions  - Create simultaneous versions of your model when you want to work on two or more versions of your data at once. It means this can also be created simultaneously, so multiple versions can exist in parallel.

Let us take the best out if simultaneous version  which can help business in such a manner that  one consistent version can be dedicatedly available for consumption by the all consumers of Product master data. Another version of Product master data can exist in parallel that can be used for adding or deleting or modifying members or for testing the model data.

Now the questions is how should be attain this?

Suppose you have the Product model which looks like below in Production environment.

Environment
Model
Versions
Version Flag
Status
Subscription View
Copied From Version
Comments
Production
Product
V1
F1
Open
S1
-
Version in use

 Now to attend our scenario we have to follow below steps:
  1. First create 2 flags F1 and F2 for version V1 if it does not exist
  2. Add flag F1 to version V1
  3. Lock V1 if it is used by multiple users
  4. Validate V1
  5. Commit V1
  6. Create new version V2 from old version V1
  7. Map Flag F1 to newly created version V2
  8. Version V2 with Flag F1 will be current version in use
  9. Create new version V3 from old version V1
  10. Map Flag F2 to newly created version V3
  11. Version V3 with flag F2 will be version where you can make modifications

For Assigning, Locking, Validating and Committing versions, please refer to MSDN. I don’t want to repeat those steps as it is already available on internet.

After following above steps the Product model will look like below in Production environment:


Environment
Model
Versions
Version Flag
Status
Subscription View
Copied From Version
Comments
Production
Product
V1
Commited
S1
-
Locked
Production
Product
V2
F1
Open
S2
V1
Version in use
Production
Product
V3
F2
Open
S3
V1
Version available for making modifications

 It means now V2 with F1 is open for use for consumers of Master Data and V3 is available for making changes as well as testing the model. Now assume you are done with your changes in V3 and you want that consumers should start using V3. How you will make it happen? It is simple and you have to follow below steps:

  1. Validate V2 and V3
  2. Lock V2 and V3
  3. Commit V2 and V3
  4. Create new version V4 from old version V3
  5. Map Flag F1 to newly created version V4
  6. Version V4 with Flag F1 will be current version in use
  7. Create new version V5 from old version V3
  8. Map Flag F2 to newly created version V5
  9. Version V5 with flag F2 will be version where you can make modifications

After following above steps the Product model will look like below in Production environment:
 

Environment
Model
Versions
Version Flag
Status
Subscription View
Copied From Version
Comments
Production
Product
V1
Commited
S1
-
Locked
Production
Product
V2
Commited
S2
V1
Locked
Production
Product
V3
Commited
S3
V1
Locked
Production
Product
V4
F1
Open
S4
V3
Version in use
Production
Product
V5
F2
Open
S5
V3
Version available for making modifications

I have also come across multiple constraint while experimenting above steps. It is good to know about it before you start blindly using  it.

Constraints ( Very Very Important)

  • As the subscription views are created based on the Version Flags and not on Version. So we don’t have to change the subscription views for the newly created version. THIS IS ONLY APPLICABLE IF you add members to entity.
  • When you add attribute to entity then all the subscription view referring to that entity, needs to be regenerated to reflect this change. The old view will still be working but will not show the newly added attribute.
  • You can't delete attribute if you have already defined subscription view for the same entity and model. If you still want to delete it then you have to first delete the subscription view than delete the attribute and then recreate the subscription view.

No comments:

Post a Comment