Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Stereotype not applied to the xmi output file !(applyStereotype() does not really apply/add stereotype to the output xmi file even getAppliedStereotypes() return correct result)
Stereotype not applied to the xmi output file ! [message #1238193] Fri, 31 January 2014 16:14 Go to next message
Naif Mokhayesh is currently offline Naif MokhayeshFriend
Messages: 31
Registered: November 2011

in a In-Place transformation I follow same steps in

and I got strange execution behaviour due to the following bug

However, after installing recent update (25 Jan, 2014) it was successfully applying Stereotype using applyStereotype() and I verify it using getAppliedStereotypes() during transformation execution.

The problem is that after finishing transformation nothing added to the output xmi file.!! I mean the applied stereotype during execution and it was verified by getAppliedStereotypes() is not shown in output xmi file

I do not why I get applied stereotype during execution but not actually added to the output xmi file.

any advice please...

Re: Stereotype not applied to the xmi output file ! [message #1245582 is a reply to message #1238193] Fri, 14 February 2014 01:50 Go to previous message
Naif Mokhayesh is currently offline Naif MokhayeshFriend
Messages: 31
Registered: November 2011
Hi ,

since around two weeks no one suggest a solution or confirm a bug ! maybe my question was not clear !

However, the following is testing code. I hope it makes my question more clear and get feedback and really I appreciate that

thanks a lot Smile

modeltype UML uses '';

transformation ApplyingStereotype(inout src : UML , in stereotypedModel : UML);
This transformation will take two input models. 
First one (src) is the model that we need to refactor it. 
The second model has stereotyped states that we need just 
copy it with its applied stereotypes to the scr model (refactored model - inout model)

main() {

	// according to
	// apply stereotypes after adding new state from stereotypedModel
	//after adding new state we list all applied stereotypes for the recent added state
	src.objectsOfType(State)[name = "TestState"]->listAllAppliedStereoyes();
	It seems running since we will get the correct results, 
	but when we check the output xmi file there is no stereotype applied 
	to that state ! but the  stereotype it self is added but not linked/referenced to the 
	corresponding state (the state copied from the second input model)
	You can execute ListAllAppliedStereotype.qvto for verification

mapping inout Model::toModel(){
	-- note that the profile is already applied	!
	// for nesting models

mapping inout StateMachine::toStateMachine(){

mapping inout Region::toRegion(){
	// add new state to src model (refactored model --inout)
	self.subvertex += stereotypedModel.objectsOfType(State)->selectOne(S : State | = "TestState");

// in the context of src model
mapping inout State::copyStereotypes() when { = "TestState"}
	// select matching stereotyped state from stereotypedModel
	var stereotypedState : State;
	stereotypedState := stereotypedModel.objectsOfType(State)->selectOne(S : State | =;
	var stereotypSet : Set(Stereotype);
	stereotypSet := stereotypedState.getAppliedStereotypes();
	// applyStereotype to the recent added state in the src model.


query State::listAllAppliedStereoyes() : Void{
	var value : String ;
		log("New added State Name is : " +;
		log("Applied Stereotype is : " +;
			value := self.getValue(appliedStereoType,;
			log("attribute name is : " + + " and value is : " + value); 

Previous Topic:Setting a configuration property from Java
Next Topic:Failed to save model to platform:/resource
Goto Forum:

Current Time: Thu Jul 07 15:01:01 GMT 2022

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

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

Back to the top