Lors de la génération d’un MCD à partir d’un MPD et que l’option « Réutilisation admise » est sélectionnée, les éléments de données sont créés dans le cadre du MCD en utilisant la fonctionnalité de réutilisation des éléments de données. | |||||||||||||
Situations :
Définition des options de modèle pour un MCD/MLD
Note :
Dans un modèle MCD vous ajoutez le script de transformation suivant dans un fichier d’extension .xem avec le profil Information Sub %Transformation%(obj, trfm) dim pData dim pAttr dim pModel : Set pModel = obj.Model ' On vérifie si l'option Réutilisation admise a été assignées if (pModel.GetModelOptions().DataItemAllowReuse) then for each pData in pModel.DataItems if isTwinInfo(pData, obj) then for each pAttr in obj.Attributes Set pAttr.DataItem = pData next obj.Delete exit for end if next end if End Sub
Function isTwinInfo(i1, i2) if (i1 is i2) then isTwinInfo = False elseif (i1.Name <> i2.Name) then isTwinInfo = False elseif (i1.Code <> i2.Code) then isTwinInfo = False elseif (i1.Datatype <> i2.Datatype) then isTwinInfo = False else isTwinInfo = True end if end function Finalement ajouter dans le fichier .xem un profil de transformation, en incluant la transformation précédente au niveau du « post-generation » Lors de la génération d’un modèle physique vers un modèle conceptuel, sélectionner »Enable Transformation » et sélectionner la propriété appropriée. |
|||||||||||||
This is a great way to enforce consistency throughout the data dictionary model.
Table of contents
if allowed to re-use a field need to be configured with the following data modeling powerdesigner
Tools -Model Options-DataItem (bottom right corner of the dialog box) to the front unique code and Allow reuse checkbox hook all removed, so that you can re-use a field in more than one table.
Note: If you check, then allow reuse, re-use multi-table a field, the value is the same name, and in some cases, this is very inconvenient, because in different fields in the table have different meanings.
Entity Attribute name uniqueness problem occurs:
Select – after « Tools> Model Options » « Allow reuse » check box is also proposed to remove the hook
Tool-> check model … removed under Entity Attribute
Entity Attribute name uniqueness and Entity Attribute code uniquenes
Copying Entities
You can make a copy of an entity within the same model or between models. When you copy an entity, you create a new entity with a new name and code, attributes, and identifiers. Model options control whether you create new data items or reuse the data items that are attached to the original entity.
Creating an Attribute
You can create an entity attribute from the Attributes tab in the property sheet of an entity, association, or inheritance.
You can use the following tools, available on the Attributes tab:
Tool | Description |
---|---|
Add a Row – Creates a new attribute and associated data item.
If you have enabled the Allow Reuse model option (see Setting CDM/LDM Model Options), the new data item can be used as an attribute for other objects. If you have enabled the Allow Reuse and Unique Code model options and you type the name of an existing data item, it will be automatically reused. |
|
Add Data Item (CDM)/Add Attributes (LDM) – Opens a Selection window listing all the data items/attributes available in the model. Select one or more data items/attributes in the list and then click OK to make them attributes to the object.
If the data item/attribute has not yet been used, it will be linked to the object. If it has already been used, it will be copied (with a modified name if you have enabled the Unique code model option) and the copy attached to the object. |
|
Reuse Data Item (CDM) – Opens a Selection window listing all the data items/attributes available in the model. Select one or more data items/attributes in the list and then click OK to make them attributes to the object. |
Deleting Attributes (CDM)
When you delete an attribute, model options determine whether or not the corresponding data items are also deleted:
Model options selected | Result of deleting an attribute |
---|---|
Unique Code and Allow Reuse | Does not delete corresponding data item |
Unique Code only | Does not delete corresponding data item |
Allow Reuse only | Deletes corresponding data item if it is not used by another entity |
None | Deletes corresponding data item |