eclipse-qvto / org.eclipse.qvto

Eclipse Public License 2.0
0 stars 1 forks source link

problem in setting stereotype value #387

Open eclipse-qvt-oml-bot opened 6 days ago

eclipse-qvt-oml-bot commented 6 days ago

| --- | --- | | Bugzilla Link | 266675 | | Status | REOPENED | | Importance | P3 critical | | Reported | Mar 02, 2009 09:01 EDT | | Modified | Mar 06, 2021 00:57 EDT | | Reporter | shirin |

Description

I want set stereotype from a uml model to another model, the following code is our qvt code:\ mapping Property::toProperty() : Property {\ init {\ \ \ var s:=self.getAppliedStereotypes()->selectOne(e| e.name = 'Column');\ var column:= object Column{\ name := self.getValue(s, 'name').oclAsType(String);\ --base_Property := self;\ };\ \ result.setValue(s,'id',column);\ \ }\ }\ i need a relation between element and stereotype value, this relation is assigned in xmi file using "id" and "base_property". I can't set the base_property to element's id in my steretype value, the commented code (base_property := self)does not work. \ I also tested result.applystereotype(s); code but it doesn't have any effect on the result. \ Is this bug is same Applying stereotypes to out uml model Bug :\ http://www.eclipse.org/newsportal/article.php?id=3912&group=eclipse.modeling.m2m\#3912\ I appreciate any help .

Thanks

eclipse-qvt-oml-bot commented 6 days ago

By Sergey Boyko on Mar 11, 2009 14:11

Created attachment 128414 Proposed patch that fixes bug with UML stereotype supporting

Meaningful changes are in two classes: ModelParameterExtent and EvaluationUtil.

:notepad_spiral: modelextent-patch

eclipse-qvt-oml-bot commented 6 days ago

By Sergey Boyko on Mar 11, 2009 16:36

Created attachment 128446 Sample project used to test proposed patch

Profiles.qvto makes use of statically defined UML profile

:compression: uml.profiles.zip

eclipse-qvt-oml-bot commented 6 days ago

By Sergey Boyko on Mar 14, 2009 10:42

Fixed.

It in fact corresponds to the bug "Applying stereotypes to out uml model" (http://www.eclipse.org/newsportal/article.php?id=3912&group=eclipse.modeling.m2m\#3912).

As for the code snippet from Comment #1. Property 'base_Property' relates to stereotype instance that is stereotype application. That's why assignment 'baseProperty := self' is not valid (there's no such property in "Column" class). \ Of course 'base' like properties are set with 'applyStereotype(s)' call which now accomplishes correctly.

eclipse-qvt-oml-bot commented 6 days ago

By Ed Willink on Mar 06, 2021 00:57

The sample project used to test the patch does not contribute to a QVTo JUnit regression test.