Setting up a data model and creating some business entities - 6.2

Talend MDM Platform Studio User Guide

EnrichVersion
6.2
EnrichProdName
Talend MDM Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The first step at the beginning of any MDM project involves setting up a data model and creating business entities in this data model.

Creating a data model

To create a data model, do the following:

  1. In the MDM Repository tree view, right-click Data Model and select New from the contextual menu.

  2. 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.

    Warning

    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.

Creating business entities in the 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:

  1. In the editor, right-click anywhere in the Data Model Entities panel, and then click New Entity.

  2. In the [New Entity] dialog box that opens, enter a name for your new entity in the Name field: Product.

  3. 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.

  4. 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.

    Note

    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.

Defining attributes

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:

  1. Expand the Product business entity and anonymous type, right-click the default Primary Key record and then click Edit Element in the contextual menu.

  2. Change the name to Id, set the minimum and maximum occurrences to 1, and then click OK to close the dialog box.

  3. 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.

    Element type

    Element name

    Minimum occurence

    Maximum occurence

    StringName11
    DecimalPrice11
  4. Save your changes.

    A [Validation Result Dialog] dialog box opens to show the validation result.

  5. 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.

Granting access control at the entity level (access control annotation)

Access control is handled inside the data model through setting up specific annotations.

To define access control on a business entity, do the following:

  1. In the data model editor, right-click the Product entity and then select Set the Roles with Write Access.

  2. 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.

  3. Click the [+] button to add the selected role to the Roles list.

  4. 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.