Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mdt-papyrus.dev] multiple inheritance in profile

Hi

Gery: Apologies , I thought you were a user not developer. A repro is ideally a simple zipped project that may be downloaded and used to examine the problem free from the complexity of a large application.

I recall struggling with multi-metaclassing for the OCL evaluation since exactly one set of Element slots should be reified regardless of whether Stereo1, Stereo2 or Child is instantiated.

After a bit of thought the problem seems very simple:

Child must provide an Extension association to redefine the two inherited Extensions to eliminate the ambiguity.

In Papyrus, you perhaps just draw a Child to Element metaclass relationship and add the redefinitions in the properties pages.

I think my OCL tests have some Extension redefinitions, so perhaps it's a simple OMG model bug requiring the missing redefinition. Add it to the model and the tooling may work.

    Regards

        Ed Willink

On 28/03/2017 11:08, REVOL Sébastien wrote:

Hi all,

To complete the discussion, the duplicated features are those generated by the “extends relationship” : let’s consider a stereotype “Child” that inherits from Stereo1 and Stereo2 [1].  Both of them extend the same “Element” metaclass.

In practice ecore generates a “base_Element” eRef for both Stereo1 and Stereo2.

 

In theory, those features have the same meaning and they should be merged in Child.

 

By default, with the “discard” option for duplicated feature inheritance, the UML to Ecore generator directly removes the Stereo2 inheritance [2].

 

“Process” option preserves the inheritance, but renames the one of the features [3].

 

“Ignore” option preserve feature names and inheritance, but a model validation error occurs [4].

 

Last, “Report” option directly stops the process when the UML model loaded [5].

 

I don’t know if it’s a known issue and if there is an existing solution?  (feature redefinition?)

 

 

[1]

 

[2]

 

[3]

 

[4]

 

 

[5]

 

-----Message d'origine-----
De : mdt-papyrus.dev-bounces@xxxxxxxxxxx [mailto:mdt-papyrus.dev-bounces@xxxxxxxxxxx] De la part de MAGGI Benoit
Envoyé : mardi 28 mars 2017 11:39
À : Papyrus Project list <mdt-papyrus.dev@xxxxxxxxxxx>
Objet : [PROVENANCE INTERNET] Re: [mdt-papyrus.dev] multiple inheritance in profile

 

Hi Ed,

 

Gery is currently working on the BPMN Papyrus DSML, you may find all sources in this eclipse repository [1].

I think it's quite natural for him to use this mailing list for such tricky dev question.

 

The root issue is that OMG BPMN profile is indeed using multi-inheritance and same property name [2].

(IMHO: very bad idea, but I didn't check if it's valid for an UML profile)

 

Maybe it should be reported as OMG bug?

 

Regards,

Benoit

 

1: https://git.eclipse.org/c/papyrus/org.eclipse.papyrus-bpmn.git/

2: BPMNActivity extends InteractionNode and BaseElement BaseElement and InteractionNode both have a base_Element property.

 

-----Message d'origine-----

De : mdt-papyrus.dev-bounces@xxxxxxxxxxx [mailto:mdt-papyrus.dev-bounces@xxxxxxxxxxx] De la part de Ed Willink Envoyé : mardi 28 mars 2017 11:22 À : Papyrus Project list <mdt-papyrus.dev@xxxxxxxxxxx> Objet : Re: [mdt-papyrus.dev] multiple inheritance in profile

 

Hi

 

This is the Papyrus developers list. Please use the Papyrus forum for Papyrus usage questions. Use the UML2 forum for UML questions.

 

You haven't provided a repro so I may be misunderstanding what is nasty.

 

base_XXX/extension_XXX is effectively reserved for use by the Stereotype implementation mechanics. Very bad practice to re-use it. Imperfect tooling may get confused.

 

Duplicate feature names are prohibited in Ecore and UML. In Ecore (for the reified Stereotype) you would be in trouble. However UML provides a redefinition capability. This should be used to break the conflict. I've only used it in some superficial OCL test cases, so you may have some bugs to circumvent. Raise Bugzillas with fulll project repros.

 

     Regards

 

         Ed Willink

 

On 28/03/2017 09:53, DELOGE Gery 249233 wrote:

> Hi,

> 

> I had annoying exceptions in BPMN. The root cause was an issue in BPMN profile generated code with multiple inheritance.

> A stereotype inherits from two parents who have each a property named with the same name.

> Basically BPMNActivity inherits from InteractionNode and from BaseElement who have both a base_element attribute.

> 

> Initial configuration was UML2 generator (xmlns:genmodel="http://www.eclipse.org/uml2/2.2.0/GenModel in genmodel file) and DUPLICATE_FEATURE_INHERITANCE set to DISCARD.

> In this case, the inheritance from InteractionNode is not present in generated code and effect is IllegalArgumentException.

> 

> First test was renaming base_element attribute in InterractionNode and keeping DUPLICATE_FEATURE_INHERITANCE to discard.

> Code was generated without error and multiple inheritance is fine.

> 

> Second test was setting DUPLICATE_FEATURE_INHERITANCE to Process. In that case multiple inheritance is generated correctly but I have one error in generated code in a switch case in eIsSet method

>             case BPMNProfilePackage.INTERACTION_NODE__BASE_ELEMENT:

>                           return isSetBase_Element();

> INTERACTION_NODE__BASE_ELEMENT cannot be resolved or is not a field

> Commenting this case and everything look fine.

> 

> Does anyone already have this issue ?

> What is the best solution ?

> 

> Cheers,

> Géry

> 

> 

> _______________________________________________

> mdt-papyrus.dev mailing list

> mdt-papyrus.dev@xxxxxxxxxxx

> To change your delivery options, retrieve your password, or

> unsubscribe from this list, visit

> https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev

> 

 

 

---

This email has been checked for viruses by Avast antivirus software.

https://www.avast.com/antivirus

 

_______________________________________________

mdt-papyrus.dev mailing list

mdt-papyrus.dev@xxxxxxxxxxx

To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev

_______________________________________________

mdt-papyrus.dev mailing list

mdt-papyrus.dev@xxxxxxxxxxx

To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev



_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev


Virus-free. www.avast.com

Back to the top