Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL to EMFTVM migration problems
ATL to EMFTVM migration problems [message #1836257] Sat, 26 December 2020 21:17 Go to next message
Burak Karaduman is currently offline Burak KaradumanFriend
Messages: 84
Registered: July 2018
Member
Dear All,

I wrote my code in ATL and I am trying to adapt it to EMFTVM. However, it generates lots of problems, I was able to solve some of them.


rule TaskToProcess {
from
pim: PIM!Task (

)
to
processthread: PSM!Process (
Name <- pim.Name,
hasSensor <- pim.sense,
)
}


In the first phase, the following problem was generated.

org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.IllegalArgumentException: Cannot assign 6f89b64:PSM!Sensor to multi-valued field Process_Thread::hasSensor ...


Then, I tried to modify the line from ( hasSensor <- pim.sense ) to (hasSensor <- Sequence{pim.sense}). I solved many problems using Sequence{}. However, new problem was also generated.


org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.IllegalArgumentException: Cannot add/remove OclUndefined to/from multi-valued field Process_Thread::hasSensor ...



Some elements do not have to be added to the model and Oclundefined is generated because of this. How can overcome this problem? Is there a better way to adapt ATL code to EMFTVM code?

Re: ATL to EMFTVM migration problems [message #1836284 is a reply to message #1836257] Mon, 28 December 2020 10:22 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

You also need to cover the case of pim.sense being OclUndefined (null), which should assign an empty Sequence instead of Sequence{OclUndefined}.

I've added an example with an ATL library you can use to wrap single values in ATL Collections at https://github.com/dwagelaar/atl.examples/tree/main/ATLSingleToMultiProperty


Cheers,
Dennis
Re: ATL to EMFTVM migration problems [message #1836673 is a reply to message #1836284] Mon, 11 January 2021 18:27 Go to previous message
Burak Karaduman is currently offline Burak KaradumanFriend
Messages: 84
Registered: July 2018
Member
Thank you so much Dennis.
Previous Topic:Module and Library inclusion problem
Next Topic:Java API information
Goto Forum:
  


Current Time: Thu Apr 25 07:42:06 GMT 2024

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

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

Back to the top