Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » [ATL] Ask for help problem rule atl beginnner level
[ATL] Ask for help problem rule atl beginnner level [message #1760987] Fri, 05 May 2017 00:34 Go to next message
saida Haidrar is currently offline saida HaidrarFriend
Messages: 2
Registered: May 2017
Junior Member
Hello,
i want to make an atl transformation from a requirement model which is compliant with metamodel 1
index.php/fa/29248/0/
to a trace model which is conform to metamodel 2 .
index.php/fa/29249/0/
for example, if requirement in the input model has an EReference called DerivedRequirement (see metamodel 1)
first i should create a helper that will verify the existence of this EReference
then i want to get by transformation the link DeriveReqt that will have two Ereferences supplier and client ( see metamodel 2). the supplier name will be after transformation the name of derivedRequirement and client name will be the requirement name.

i tried this atl code :
helper context ReqDLMM!Requirement def : DeriveReq():Boolean =
if not self.DerivedRequirement.oclIsUndefined() then
true
else
false
endif
;
rule Req2DeriveLink{
from r:ReqDLMM!Requirement(r.DeriveReq() and r.oclIsTypeOf(ReqDLMM!Requirement))
to d:ReqTraceMM!TraceLink (
client <- r.DerivedRequirement.name ,
supplier <- r.name,
type <- d.DeriveReqt ,
category <- d.TraceBetReq
)

but this doesn't work.
I got this error :
org.eclipse.m2m.atl.engine.emfvm.VMException: Collections do not have properties, use ->collect()
at __applyReq2DeriveLink#13(ReqDLTransform.atl[41:13-41:38])
local variables: self=ReqDLTransform : ASMModule, link=TransientLink {rule = Req2DeriveLink, sourceElements = {r = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@461d2716 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@2ffa002d (name: Requirement) (instanceClassName: null) (abstract: false, interface: false))}, targetElements = {d = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@343b6be7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@2385dca2 (name: TraceLink) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}, r=IN!<unnamed>, d=OUT!<unnamed>
at __exec__#8(ReqDLTransform.atl)
local variables: self=ReqDLTransform : ASMModule, e=TransientLink {rule = Req2DeriveLink, sourceElements = {r = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@461d2716 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@2ffa002d (name: Requirement) (instanceClassName: null) (abstract: false, interface: false))}, targetElements = {d = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@343b6be7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@2385dca2 (name: TraceLink) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}
at main#24(ReqDLTransform.atl)
local variables: self=ReqDLTransform : ASMModule


is someone could help me, i will be so so grateful.
thank you
Re: [ATL] Ask for help problem rule atl beginnner level [message #1761179 is a reply to message #1760987] Mon, 08 May 2017 15:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5629
Registered: July 2009
Senior Member
Hi

Sorry. If you want me to look at this you'll have to provide something that I can look at within Eclipse. See https://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink
Re: [ATL] Ask for help problem rule atl beginnner level [message #1765421 is a reply to message #1761179] Fri, 09 June 2017 10:30 Go to previous message
saida Haidrar is currently offline saida HaidrarFriend
Messages: 2
Registered: May 2017
Junior Member
Hello, it's me again
I am asking about the possibility to create an output pattern inside the Block Do of an imperative rule. If yes how?
Previous Topic:ATL : target model
Goto Forum:
  


Current Time: Tue Feb 20 22:05:31 GMT 2018

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

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