The first step at the beginning of any MDM project involves setting up a data model and creating business entities in this data model.
To create a data model, do the following:
In the MDM Repository tree view, right-click Data Model and select New from the contextual menu.
Name your data model Product, and then click OK.
By default, the Create the corresponding Data Container at the same time check box is selected, so that the corresponding data container with the same name will be created.
If needed, you can clear this check box and create the corresponding data container with the same name later. For more information, see Defining a data container.
A data container and its corresponding data model must have the same name.
In the Studio workspace, an editor opens where you can define some of the details of your new data model.
Once you have created your data model, you need to populate it with some business entities.
To create a business entity in your data model, do the following:
In the editor, right-click anywhere in the Data Model Entities panel, and then click New Entity.
In the [New Entity] dialog box that opens, enter a name for your new entity in the Name field: Product.
Select the Complex Type option.
You use the Simple type option if you want to define a single element type such as a phone number or an email address, and the Complex type option if you want to define a more complete structure, such as an address or, in this case, the different attributes that describe a product.
Leave the other options unchanged and click OK to add your new entity to the editor.
The created business entity is listed in the Data Model Entities panel with a by default record, which takes its name from the entity name with the suffix Id, and the complex type, if any, is displayed in the Data Model Types panel.
Each time you create a new business entity, a default Primary Key record, which takes its name from the entity name with the suffix Id, and a Unique Key record which has the same name as the Entity are automatically created. For example, if you create a new business entity and name it Agency, the Primary Key record AgencyId will be created automatically.
A Primary Key can be an integer but a Foreign Key must always be a string. The server surrounds Foreign Keys with square brackets to support compound keys.
The next step in this scenario involves defining different attributes for the Product entity you have just created: its name, description and price.
To define attributes for the Product business entity, do the following:
Expand the Product business entity and anonymous type, right-click the default Primary Key record and then click Edit Element in the contextual menu.
Change the name to Id, set the minimum and maximum occurrences to 1, and then click OK to close the dialog box.
Right-click Id, click Add Element (after) in the contextual menu, and then add each of the following elements with the characteristics shown in the table below.
String Name 1 1 Decimal Price 1 1
Save your changes.
A [Validation Result Dialog] dialog box opens to show the validation result.
In the MDM Repository tree view, expand the Data Model node, right-click the Product data model, and then select one of the deployment options to deploy your changes to the MDM Server.
Access control is handled inside the data model through setting up specific annotations.
To define access control on a business entity, do the following:
In the data model editor, right-click the Product entity and then select Set the Roles with Write Access.
In the dialog box that opens, click the arrow in the upper right corner of the dialog box to display a list of the roles defined in the Studio, and then select the role to which you want to grant write access to the selected business entity.
In this example, System_Admin is selected.
Click the [+] button to add the selected role to the Roles list.
If required, do the same to grant access to as many roles as needed and then click OK to validate your changes and close the dialog box.
In the Product entity, you can expand the Annotations node to check the role(s) that have access to the entity.