Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 382978 - [pivot] No implementation for 'UML::uml::Element.getAppliedStereotypes()'
Summary: [pivot] No implementation for 'UML::uml::Element.getAppliedStereotypes()'
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: M6   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 382975
  Show dependency tree
 
Reported: 2012-06-19 10:20 EDT by Patrick Tessier CLA
Modified: 2014-05-27 09:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Tessier CLA 2012-06-19 10:20:15 EDT
Version of OCL
OCL for the UML Metamodel 
Version: 4.0.0.v20120611-1210


When I write this query on a class :
 
self.getAppliedStereotypes()

Results:
Evaluation failure
No implementation for 'UML::uml::Element.getAppliedStereotypes()'
Comment 1 Ed Willink CLA 2012-06-21 11:08:01 EDT
I've just pushed my bug/365447 branch that adds support for stereotypes so that the functionalirty of getAppliedStereotypes() should be available as oclType().appliedStereotype. Just needs the wrapping operation to give it the API name.

There are 299 Operations in the Eclipse UML 4.0 metamodel; probably none of them have operation bodies. Rather than write all 299 again, the plan is to auto-generate them from the UML 2.4.1/2.5 specification so that they are consistent and evolve to being correct. Si milar auto-generation will support the MDT/UML2 code.

I can do perhaps 10 operations now, if you really need them, but 299 by hand is no fun. I hope to have auto-generation in perhaps a month. (About 20 validation rules in OCL 4.0 are already auto-generated.).
Comment 2 Ed Willink CLA 2012-07-02 07:55:47 EDT
(In reply to comment #1)
> I can do perhaps 10 operations now, if you really need them, but 299 by hand is
> no fun. I hope to have auto-generation in perhaps a month. (About 20 validation
> rules in OCL 4.0 are already auto-generated.).

Not so bad: 299 Operations, but only 81 Queries and many are quite trivial but all have to be reverse-engineered from the MDT/UML2 Java.
Comment 3 Ed Willink CLA 2012-09-06 14:52:58 EDT
This proves to be rather easy; just introduce an EInvokeOperation to support an EObject domain invocation of eInvoke.

Pushed to master.
Comment 4 Ed Willink CLA 2013-02-14 15:50:18 EST
Supporting e.g. getAppliedStereotypes() for parsing at M2 (e.g. in a Profile) and execution at M1 (e.g. when validating a diagram) is relatively straightforward; the user model extends the MDT/UML2 metamodel in which Element::getAppliedStereotypes() is available. With extension_xxx and base_xxx available the extended MDT/UML2 methods may be less useful since they lose type information.

Supporting e.g. getAppliedStereotypes() for parsing at M1 (e.g. in a user Class invariant) and execution at M0 (e.g. when the user objects exist) is troublesome.

User objects do not normally extend Element, so the operation is not visible. If a static OclElement::getAppliedStereotypes() existed/was synthesized then all user types would have all the MDT/UML2 API added; can't be right. Therefore an M1 activation should be e.g. self.oclType().getAppliedStereotypes() to explicitly climb to the meta-level. This is now parseable, but is it executable?

When using EMF, all UML instances are EObject and so they have EClasses but no UML Classes and so no Element objects on which to invoke getAppliedStereotypes().

Options:
- create the UML by Ecore2UML conversion
-- but stereotypes won't exist
- create the UML by finding and loading the original UML resource
-- but it may not be findable
- create the Pivot from the EClass
-- but stereotypes won't exist and all UML ops need implementing for Pivot

It seems execution from M0 is only practical if the UML2Ecore converter copies a stereotype description into the EAnnotations. 

Since access from M0 requires enhanced MDT/UML2 modeling this is an enhancement. Bug 400850 raised.

This bug is solely concerned with access from M1.
Comment 5 Ed Willink CLA 2013-02-14 16:18:14 EST
Working for M5, additional tests clarifying M1/M0 behaviour added for M6.
Comment 6 Ed Willink CLA 2014-05-27 09:44:55 EDT
CLOSED after more than a year in RESOLVED state.
Comment 7 Ed Willink CLA 2014-05-27 09:52:56 EDT
and CLOSE