[ATL] Ask for help problem rule atl beginnner level [message #1760987] |
Fri, 05 May 2017 00:34 |
saida Haidrar 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
to a trace model which is conform to metamodel 2 .
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02987 seconds