[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[mdt-papyrus.dev] multiple inheritance in profile
|
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