Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [Solved][ATL] string concat operation OclUndefined ???
icon8.gif  [Solved][ATL] string concat operation OclUndefined ??? [message #830358] Tue, 27 March 2012 14:33
david borsodi is currently offline david borsodiFriend
Messages: 19
Registered: July 2009
Junior Member
Hello

I'm trying to follow the family-person example but I ran into a problem:
the execution repeatedly tells me that neither '+' nor concat is defined for the string type. I think I did everything as it was proposed. Without concat the code runs and produces the desired output.
Trace below. I also include the source, but it is almost identical to the tutorial code...
thanks
david

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: OclUndefined.concat(java.lang.String)
at __applyMember2Male#14(Families2Persons.atl[38:16-38:39])
local variables: self=Families2Persons : ASMModule, link=TransientLink {rule = Member2Male, sourceElements = {s = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1fcbeda (eClass: org.eclipse.emf.ecore.impl.EClassImpl@503993 (name: Family) (instanceClassName: null) (abstract: false, interface: false))}, targetElements = {t = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1ebdcd7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@de643a (name: Male) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}, s=IN!<unnamed>, t=OUT!<unnamed>
at __exec__#8(Families2Persons.atl)
local variables: self=Families2Persons : ASMModule, e=TransientLink {rule = Member2Male, sourceElements = {s = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1fcbeda (eClass: org.eclipse.emf.ecore.impl.EClassImpl@503993 (name: Family) (instanceClassName: null) (abstract: false, interface: false))}, targetElements = {t = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1ebdcd7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@de643a (name: Male) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}
at main#30(Families2Persons.atl)
local variables: self=Families2Persons : ASMModule


-- @path Families=/FamiliesAndPersons/model/Families.ecore
-- @path Persons=/FamiliesAndPersons/model/Persons.ecore
module Families2Persons;

create OUT: Persons from IN: Families;

helper context Families!Member def : isFemale(): Boolean =
if not self.familyMother.oclIsUndefined() then
true
else
if not self.familyDaughter.oclIsUndefined() then
true
else
false
endif
endif;

helper context Families!Member def: familyName: String =
if not self.familyFather.oclIsUndefined() then
self.familyFather.lastName
else
if not self.familyMother.oclIsUndefined() then
self.familyMother.lastName
else
if not self.familySon.oclIsUndefined() then
self.familySon.lastName
else
self.familyDaughter.lastName
endif
endif
endif;

rule Member2Male {
from
s: Families!Member (not s.isFemale())
to
t: Persons!Male (
fullName <- s.firstName.concat(' ').concat(s.familyName)
)

}

rule Member2Female {
from
s: Families!Member (s.isFemale())
to
t: Persons!Female (
fullName <- s.firstName.concat(' ').concat(s.familyName)
)
}

[Updated on: Wed, 28 March 2012 06:37]

Report message to a moderator

Previous Topic:[ATL] Transform several elements into one element
Next Topic:[Solved][ATL] problem running ATL programmatically
Goto Forum:
  


Current Time: Fri Apr 26 15:30:32 GMT 2024

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

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

Back to the top