Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Code Completion / Operations in QVT installation
Code Completion / Operations in QVT installation [message #870078] Sun, 06 May 2012 08:06 Go to next message
Tex Iano is currently offline Tex IanoFriend
Messages: 99
Registered: February 2012
Member
Hi,

in the archive (google cache) I found this QVTo transformation:

modeltype entities "strict" uses entities('example.com/entities');
modeltype persistence "strict" uses persistence('example.com/persistence');
modeltype uml "strict" uses uml('www.eclipse.org/uml2/3.0.0/UML');
(link problem, so there is no ht...)	

transformation swichprofile(in umlIn:entities, in persistenceProf:uml, out umlOut:persistence);

main() {
	-- copy root model(s)
	var _result := umlIn.rootObjects()[uml::Model].deepclone();
	_result[uml::Model]->forEach(model) {
		-- is "entities" Profile applied?
		if(model.getAppliedProfile('entities') <> null) then {
			-- remove application of "entities" profile
			model.unapplyProfile(model.getAppliedProfiles()![name='entities']);
			-- apply "persistence" profile instead
			model.applyProfile(persistenceProf.objectsOfType(uml::Profile)![name='persistence']);
		} endif;
	};
	-- now transform "entity" stereotype applications
	umlIn.objectsOfType(entities::Entity).map toPersistent();
	_result;
}

mapping entities::Entity::toPersistent() : persistence::Persistent {
	persistent_name := self.table_name;
	-- figure out which class the stereotype should be applied to
	base_Class := umlOut.objectsOfType(uml::Class)![qualifiedName = self.base_Class.qualifiedName];
}


(BTW: This is of interest for the profile issue. The profile has to be part of the input models).

Back to my question:

Here we see a lot of operations:

model.getAppliedProfile()
model.unapplyProfile()

In my QVT installation I do not have these operations, even though I need them Smile I have only standard QVT operations like oclIsTypeOf etc. I have the same header (same metamodels). The posting was in the eclipse forum too, so I assume they had the same QVT installation. The posting was 2010 I think.


So whats wrong with my installation? Why do I not have alle these features?

Regards,

Tex
Re: Code Completion / Operations in QVT installation [message #870116 is a reply to message #870078] Sun, 06 May 2012 17:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7106
Registered: July 2009
Senior Member
Hi

Code completion is often helpful but I would caution against relying on
it; it's difficult to ensure that everything is offered and nothing
extra is offered. Code completion is not particularly easy to test and
not high on developer's priorities. Even JDT is pretty ropey sometimes.

getAppliedProfile is part of the Eclipse MDT/UML2 API; something similar
might one day appear from OMG.

If you're using UML.ecore in compiled and registered form it should be
available.

Regards

Ed Willink

On 06/05/2012 09:07, Tex Iano wrote:
> Hi,
>
> in the archive (google cache) I found this QVTo transformation:
>
>
> modeltype entities "strict" uses entities('example.com/entities');
> modeltype persistence "strict" uses
> persistence('example.com/persistence');
> modeltype uml "strict" uses uml('www.eclipse.org/uml2/3.0.0/UML');
> (link problem, so there is no ht...)
>
> transformation swichprofile(in umlIn:entities, in persistenceProf:uml,
> out umlOut:persistence);
>
> main() {
> -- copy root model(s)
> var _result := umlIn.rootObjects()[uml::Model].deepclone();
> _result[uml::Model]->forEach(model) {
> -- is "entities" Profile applied?
> if(model.getAppliedProfile('entities') <> null) then {
> -- remove application of "entities" profile
>
> model.unapplyProfile(model.getAppliedProfiles()![name='entities']);
> -- apply "persistence" profile instead
>
> model.applyProfile(persistenceProf.objectsOfType(uml::Profile)![name='persistence']);
> } endif;
> };
> -- now transform "entity" stereotype applications
> umlIn.objectsOfType(entities::Entity).map toPersistent();
> _result;
> }
>
> mapping entities::Entity::toPersistent() : persistence::Persistent {
> persistent_name := self.table_name;
> -- figure out which class the stereotype should be applied to
> base_Class := umlOut.objectsOfType(uml::Class)![qualifiedName =
> self.base_Class.qualifiedName];
> }
>
>
> (BTW: This is of interest for the profile issue. The profile has to be
> part of the input models).
>
> Back to my question:
>
> Here we see a lot of operations:
>
> model.getAppliedProfile()
> model.unapplyProfile()
>
> In my QVT installation I do not have these operations, even though I
> need them :) I have only standard QVT operations like oclIsTypeOf etc.
> I have the same header (same metamodels). The posting was in the
> eclipse forum too, so I assume they had the same QVT installation. The
> posting was 2010 I think.
>
>
> So whats wrong with my installation? Why do I not have alle these
> features?
>
> Regards,
>
> Tex
Re: Code Completion / Operations in QVT installation [message #870120 is a reply to message #870116] Sun, 06 May 2012 17:29 Go to previous messageGo to next message
Alain Lavoie is currently offline Alain LavoieFriend
Messages: 82
Registered: April 2012
Member
Ed Willink a écrit :

Hi everybody,

Tex, will you publish your end configuration result
on the newsgroup ? This is my next step, I can see
that you are exactly doing what I want to do.

Regards.
Re: Code Completion / Operations in QVT installation [message #870155 is a reply to message #870120] Mon, 07 May 2012 05:22 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7106
Registered: July 2009
Senior Member
No idea what this message is about.

Ed Willink wrote nothing of the sort.


On 06/05/2012 18:29, Alain Lavoie wrote:
> Ed Willink a écrit :
>
> Hi everybody,
>
> Tex, will you publish your end configuration result
> on the newsgroup ? This is my next step, I can see
> that you are exactly doing what I want to do.
>
> Regards.
Previous Topic:Access localPart of QName
Next Topic:[QVTo] UML 2 UML transform
Goto Forum:
  


Current Time: Wed Apr 21 18:45:23 GMT 2021

Powered by FUDForum. Page generated in 0.02181 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top