Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Classe's attribute not visible
[ATL] Classe's attribute not visible [message #68006] Sun, 02 December 2007 19:13 Go to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi,
I've make transformations with ATL and I've a problem.
My target metamodel is made of
two classes EVENT and PORT which inherit from a class NODE,
three classes ROOT,LEAF and INTERMEDIATE which inherit from EVENT.
Name attribute of classes is declared in NODE and other attributes
in EVENT, PORT, LEAF etc.
Now, when I write a rule, attributes of subclasses are not seen
in the model target.
How can I to visualize it?
Thanks
Luciana
Re: [ATL] Classe's attribute not visible [message #68101 is a reply to message #68006] Tue, 04 December 2007 08:53 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080109040108010304000302
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello

Luciana a
Re: [ATL] Classe's attribute not visible [message #68116 is a reply to message #68101] Tue, 04 December 2007 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hello,

Yes, this is really what happens.

Thank you
Luciana
Re: [ATL] Classe's attribute not visible [message #68140 is a reply to message #68116] Tue, 04 December 2007 11:45 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060001060406030707050307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Ok, could you paste here the code of your rule ?

Thanks in advance.
William

Luciana a
Re: [ATL] Classe's attribute not visible [message #68163 is a reply to message #68140] Tue, 04 December 2007 12:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hello,
thanks for you help.
Here there are the rules and the final model.

RULE
entrypoint rule FaultTree () {
to
ft : FT!FaultTreeModel (
description <- 'Case Study',
name <- 'Fault Tree'
)
do {
thisModule.Model <- ft;
for ( e in thisModule.allClasses) {
ft.node <- thisModule.cActor(e);
}
}
}

lazy rule cActor {
from
a : UML!Actor
(not a.useCase.isEmpty())
to
r : FT!Root (
name <- a.name,
description <- 'Vogliamo stimare la Reliability del sistema',
SystemReliability <- ' '
)

do {
r.port <- thisModule.createPort(a);
}

}

lazy rule createPort {
from
b : UML!Actor
(not b.useCase.isEmpty())
to
p : FT!Port (
name <- 'Port of ' + b.name,
type <- #typePort,
outdegree <- '1'
)
do {
(*) p.event <- thisModule.uc2Intermediate(b);
}
}
MODEL TARGET

<?xml version="1.0" encoding="ISO-8859-1"?>
<FaultTreeModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="C:\eclipse2\workspace\UML2FTA\Metamodels\" description="Case Study"
name="Fault Tree">
<node xsi:type="Root" name="System" description="Vogliamo stimare la
Reliability del sistema">
<port name="Port of System"/>
</node>
</FaultTreeModel>

I've another problem is that instuction (*) is not performed.
Perhaps I have planned badly the transformations,
with this rule I try build a model that represent a tree made of Port and
Event.
It is first time that I make transformations,
if you are some suggestion about it, these are well welcomed.

Thank you very much for all.
Luciana
Re: [ATL] Classe's attribute not visible [message #68211 is a reply to message #68163] Tue, 04 December 2007 16:36 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010601030308010306090900
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Luciana a
Re: [ATL] Classe's attribute not visible [message #68291 is a reply to message #68211] Wed, 05 December 2007 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi William,
thank you very very match about your suggestion.
I try to rewrite my transformation in a simplier form, but
my metamodel is empty and I have some errors.
Here it's all.
How can I do?
Excuse if I ask you too questions, but it is very important for me.


RULE

rule FaultTree {
from
model : UML!Model
to
ft : FT!FaultTreeModel(
description <- 'Case Study',
name <- 'Fault Tree',
node <- thisModule.cActor(model)
)

}

rule cActor {
from
a : UML!Actor
(not a.useCase.isEmpty())
to
r : FT!Root (
name <- a.name,
description <- 'Vogliamo stimare la Reliability del sistema',
SystemReliability <- '',
port <- createPort
),
createPort : FT!Port (
name <- 'Port of ' + a.name,
type <- #"or",
outdegree <- '1',
parent <- thisModule.uc2intermediate(a)
)
}

rule uc2Intermediate {
from
uc : UML!PAstep
(not uc.subject.isEmpty)
to
intermediate : FT!Intermediate (
name <- 'Reliability '+ uc.name,
composedProbability <- ' ',
port <- thisModule.useCase2Port(uc)
)
}

rule useCase2Port {
from
uc : UML!PAstep
to
porta : FT!Port (
type <- #"and",
outdegree <- 1,
name <- 'Porta'+ uc.name,
event <- Sequence { leaf, intermediate }
),
leaf : FT!Leaf (
name <- 'Evento in cui viene richiesto lo scenario '+ uc.name
basicProbability <- uc.probability
),
intermediate : FT!Intermediate(
name <- 'Reliability di tutte le operazion nello scenario ' +
uc.name,
composedProbability <- ' ',
port <- thisModule.intermediatePort(intermediate)
)
}
rule intermediatePort {
from
uc : UML!PAstep
to
port : FT!Port (
type <- #"and",
outdegree <- '1'
)


}

CONSOL

GRAVE: ****** BEGIN Stack Trace
GRAVE: exception:
GRAVE: null
java.lang.NullPointerException
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.getExtent(AS MEMFModel.java:409)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.initClassifi ersInAllExtents(ASMEMFModel.java:100)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.getClassifie r(ASMEMFModel.java:78)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.findModelEle ment(ASMEMFModel.java:150)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:281)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
GRAVE: A.main() : ??#22 null
GRAVE: local variables = {self=UML2FTA : ASMModule}
GRAVE: local stack = []
GRAVE: A.__initallClasses() : ??#6 8:45-8:54
GRAVE: local variables = {self=UML2FTA : ASMModule}
GRAVE: local stack = [UML2FTA : ASMModule, Sequence {}]
GRAVE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).
GRAVE: null
java.lang.RuntimeException
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:185)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:85)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:77)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:163)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.getExtent(AS MEMFModel.java:409)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.initClassifi ersInAllExtents(ASMEMFModel.java:100)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.getClassifie r(ASMEMFModel.java:78)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.findModelEle ment(ASMEMFModel.java:150)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:281)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
... 17 more


Thanks.
Luciana
Re: [ATL] Classe's attribute not visible [message #68301 is a reply to message #68291] Wed, 05 December 2007 16:46 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060806090603020504000303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

Luciana a
Previous Topic:Problem with driver UML2 and UML PrimitiveTypes
Next Topic:[atl] problem setting properties of stereotypes
Goto Forum:
  


Current Time: Sat Apr 10 15:27:30 GMT 2021

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

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

Back to the top