Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVT-R] Problem with subvertex
[QVT-R] Problem with subvertex [message #550172] Thu, 29 July 2010 12:59 Go to next message
Bler  is currently offline Bler Friend
Messages: 26
Registered: June 2010
Junior Member
Hi there,

I'm trying desperately to transform an uml state Machine Diagram,. I just wanted to add a new state with a region into the region off the state machine.

The input diagram looks like this:
- package
---- stateMachine
-------- smRegion
-----------.....

After the transformation it looks :
- package
---- stateMachine
--------smRegion
-----------.... .....
-compositeStete
---- csRegion

So it is in the same level of the package, I tray using 'subvertex' but I can't do it...
I would like that it be like this :

- package
----stateMachine
--------smRegion
-----------.... .....
-----------compositeStete
---------------- csRegion


My implementation look like this :

transformation stateMachinesDiagram2stateMachinesDiagram(source : uml, target : uml) {

top relation package2package {
packageName : String;
enforce domain source packageS: uml::Package {
name = packageName
};
checkonly domain target packageT: uml::Package {
name = packageName
};
}

top relation stateMachine2stateMachine {
smName : String;
enforce domain source stateMachineS: uml::StateMachine {
name = smName,
_package = packageS : uml::Package {}
};
checkonly domain target stateMachineT: uml::StateMachine{
name = smName,
_package = packageT : uml::Package {}
};
when{package2package(packageS,packageT);}
}

top relation region2region {
smName : String;
--sv : OrderedSet(uml::Vertex);
enforce domain source regionS: uml::Region {
name = smName,
-- subvertex =sv : uml::Vertex {},
stateMachine = smS : uml::StateMachine {}
};
checkonly domain target regionT: uml::Region{
name = smName,
state = newState : uml::State {
name = 'compositeStete',
region = reg : uml::Region {
name = 'csRegion'
}
},
stateMachine = smT : uml::StateMachine {}
};
when{stateMachine2stateMachine(smS,smT);}
}
}


Someone could help me please, how can I do it please ?

With regards
Re: [QVT-R] Problem with subvertex [message #550260 is a reply to message #550172] Thu, 29 July 2010 16:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Bler

Since Eclipse QVTR currently has no execution capability, you are
presumably not using Eclipse QVTr, so you should probably ask on the
support group of whatever tool you are using.

My general approach to a problem that I cannot solve is to debug it,
variously using single step, 'printf', or incremental change.

Regards

Ed Willink

On 29/07/2010 13:59, Bler wrote:
> Hi there,
>
> I'm trying desperately to transform an uml state Machine Diagram,. I
> just wanted to add a new state with a region into the region off the
> state machine.
>
> The input diagram looks like this: - package
> ---- stateMachine
> -------- smRegion
> -----------.....
>
> After the transformation it looks :
> - package
> ---- stateMachine
> --------smRegion
> -----------.... .....
> -compositeStete ---- csRegion
> So it is in the same level of the package, I tray using 'subvertex' but
> I can't do it...
> I would like that it be like this :
>
> - package
> ----stateMachine
> --------smRegion
> -----------.... .....
> -----------compositeStete ---------------- csRegion
>
> My implementation look like this :
>
> transformation stateMachinesDiagram2stateMachinesDiagram(source : uml,
> target : uml) {
> top relation package2package {
> packageName : String;
> enforce domain source packageS: uml::Package {
> name = packageName
> };
> checkonly domain target packageT: uml::Package {
> name = packageName
> };
> }
>
> top relation stateMachine2stateMachine {
> smName : String;
> enforce domain source stateMachineS: uml::StateMachine {
> name = smName, _package = packageS : uml::Package {}
> };
> checkonly domain target stateMachineT: uml::StateMachine{
> name = smName, _package = packageT : uml::Package {}
> };
> when{package2package(packageS,packageT);}
> }
>
> top relation region2region {
> smName : String;
> --sv : OrderedSet(uml::Vertex);
> enforce domain source regionS: uml::Region {
> name = smName, -- subvertex =sv : uml::Vertex {},
> stateMachine = smS : uml::StateMachine {} };
> checkonly domain target regionT: uml::Region{
> name = smName,
> state = newState : uml::State {
> name = 'compositeStete',
> region = reg : uml::Region {
> name = 'csRegion' }
> }, stateMachine = smT : uml::StateMachine {}
> };
> when{stateMachine2stateMachine(smS,smT);}
> }
> }
>
>
> Someone could help me please, how can I do it please ?
>
> With regards
>
Re: [QVT-R] Problem with subvertex [message #550265 is a reply to message #550172] Thu, 29 July 2010 16:38 Go to previous message
Bler  is currently offline Bler Friend
Messages: 26
Registered: June 2010
Junior Member
Hi Edward

Thank you so much for your commentaries, I found the solution anyway I have an other problem...

How does it possible to search an element only in the target model, please ? in QVT-R


I tray like this : uml::State.allInstances()-> select .....

Is there any possibility to specify the model, 'out' in this case, please ?

(in ATL we can Do : : uml::State.allInstancesFrom('out') )

With regards
bler
Previous Topic:[QVTO] QvtRuntimeException when running by program
Next Topic:[QVT-R] How to specify a model for searching
Goto Forum:
  


Current Time: Fri Apr 19 03:17:36 GMT 2024

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

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

Back to the top