GeertBellekens / Enterprise-Architect-Toolpack

Addins and tools for Sparx Systems Enterprise Architect
https://bellekens.com/product/bellekens-enterprise-architect-toolpack/
BSD 2-Clause "Simplified" License
101 stars 41 forks source link

Remove XSDChoice if only one option remains #91

Open GeertBellekens opened 7 years ago

GeertBellekens commented 7 years ago

In case of an XSDChoice element in the subset that only has one element to choose from the XSDChoice element can be deleted and replace by a direct link to the remaining element Example: image

The result should then look like this: image The relation between the choice object and the final object should be rerouted to the source object. The choise object should then be deleted in the subset.

GeertBellekens commented 7 years ago

workaround is to create the required result in the subset and give the resulting association an "ignored" stereotype. That way you only need to specify how you want this to work and all future re-generations will honor this. (without the stereotype the association would be deleted as it isn't present in the source model)