Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Guillaume on December 10, 2020, 07:47:22 pm

Title: Option to extend MDG metacontraints beyond the Model Validation
Post by: Guillaume on December 10, 2020, 07:47:22 pm
Meta model contraints are really useful e.g. I found the metaconstraint with umlRole = ownedPort really interesting to restrict stereotyped ports to be created against a chosen stereotype
e.g. "Type1" components can only have "Type1" ports, "Type2" components can only have "Type2" ports...

It works if I run New Child Element on the component -> I only get the Type1 port for a Type1 component.
I also understand this metaconstraint is used by the Model Validation feature.

The issue is that I can create a Type2 port from the toolbox on a Type1 Component.

Would it be possible to add an option or a new umlRole value that would prevent a user from creating a Type2 port on a Type1 component for instance?
Or is there an option out there that would let me achieve the above?

Title: Re: Option to extend MDG metacontraints beyond the Model Validation
Post by: Paolo F Cantoni on December 10, 2020, 09:20:07 pm
Meta model contraints are really useful e.g. I found the metaconstraint with umlRole = ownedPort really interesting to restrict stereotyped ports to be created against a chosen stereotype
e.g. "Type1" components can only have "Type1" ports, "Type2" components can only have "Type2" ports...

It works if I run New Child Element on the component -> I only get the Type1 port for a Type1 component.
I also understand this metaconstraint is used by the Model Validation feature.

The issue is that I can create a Type2 port from the toolbox on a Type1 Component.

Would it be possible to add an option or a new umlRole value that would prevent a user from creating a Type2 port on a Type1 component for instance?
Or is there an option out there that would let me achieve the above?
Hi Guillaume,

Sounds more like a defect to me.  If you can't create it from scratch, you shouldn't be able to do so "ex post facto".

Paolo