Book a Demo

Author Topic: How to Make Diagram Element Property Fields Required Using MDGs  (Read 3816 times)

chesterw

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Hello EA Sparx Community,

I am currently working on a project in Enterprise Architect and utilizing MDG Technologies. I need to ensure that some of the property fields for specific diagram elements are mandatory or required.

Could anyone guide me on how to configure these settings within MDGs? Specifically, I am looking for a way to enforce that certain properties must be filled out by users when they are creating or modifying elements.

For example, if I am creating a activity, the name of the activity must be filled out or you cannot create the activity.

Thank you in advance for your assistance!

Best regards,
Chester

crybeers

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: How to Make Diagram Element Property Fields Required Using MDGs
« Reply #1 on: June 24, 2024, 04:40:32 pm »
Open Enterprise Architect and navigate to Tools > UML Profile > Create Profile.
Define the Profile: Create a new UML profile where you define the stereotypes and attributes that you want to enforce as mandatory.
Add Stereotypes: Add stereotypes to represent the elements (like Activity) that you want to customize.
Define Tagged Values: For each stereotype, define tagged values representing the properties. Ensure these properties are marked as mandatory.
Define Tagged Value Types
Tagged Value Types: Navigate to Settings > UML Types > Tagged Value Types.
Add New Tagged Values: Create new tagged value types if necessary, specifying the data type and constraints.
Create an MDG Technology
MDG Technology Wizard: Use the MDG Technology Wizard to package your UML profile into an MDG Technology.
Go to Tools > Generate MDG Technology File.
Follow the wizard steps, selecting your UML profile and tagged value types.
Customization: Include your UML profile and any other customizations (e.g., Toolbox Profiles, Diagram Profiles).
Add Scripts: Use EA's scripting capabilities to enforce mandatory fields.
Go to Tools > Scripting and create a new script (e.g., JScript or VBScript).
Script Logic: Write a script that checks if the mandatory fields are filled out when creating or modifying elements.
Deploy MDG Technology: Import the MDG Technology into your EA project.
Go to Settings > MDG Technologies > Import MDG Technology and select your MDG file.
Test the Constraints: Create or modify elements in your diagrams to ensure that the mandatory field constraints are enforced.
User Notification
Inform Users: Make sure users are aware of these mandatory fields and the constraints in place.
Documentation: Provide documentation or guidelines on the new constraints and how to comply with them.