Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [EMFTVM] Comparing enum types
[EMFTVM] Comparing enum types [message #1403118] Mon, 21 July 2014 12:59 Go to next message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
Hello everybody.

I get a weird behaviour when trying to execute comparisons between enum literal types. I have the MethodType in the output model, whose values can be GET, POST, PUT and DELETE. If I used them like in the following example, the execution froze and I couldn't even stop it without closing Eclipse, although Eclipse kept working fine and I could even relaunch the transformation (with the same result).

m.getHttpMethod = #GET


getHttpMethod helper:

helper context mmMIGRARIAMVC!Mapping def : getHttpMethod : mmRestconfig!MethodType = 
	let dop : mmMIGRARIAMVC!DataOperationCall = self.controlFlow.getCalledDataOperations
			-> select(d | d.dataObject = self.getResource) in
		if not dop -> any(d | d.type = #Create).oclIsUndefined() then
			#POST
		else if not dop -> any(d | d.type = #Update).oclIsUndefined() then
			#PUT
		else if not dop -> any(d | d.type = #Remove).oclIsUndefined() then
			#DELETE
		else
			#GET
		endif
		endif
		endif;


I solved this problem by adding parentheses to the helper. But now, in other parts of the code I use the following code twice, over collections of the same type of elements, and in one of them it works properly, but in the other one I have that same issue:

-> select(po | po.direction = #Input)


Any ideas?

Thanks in advance.

Cheers!
Re: [EMFTVM] Comparing enum types [message #1403176 is a reply to message #1403118] Tue, 22 July 2014 07:13 Go to previous messageGo to next message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
Solved. The problem was that some of those po elements were OclUndefined, and for some reason the execution didn't throw an exception like this:

[emftvm.run] org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.NoSuchFieldException: Field void::direction not found
Re: [EMFTVM] Comparing enum types [message #1403454 is a reply to message #1403176] Wed, 23 July 2014 19:31 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

op 22-07-14 09:13, Fernando Macias schreef:
> Solved. The problem was that some of those po elements were OclUndefined, and
> for some reason the execution didn't throw an exception like this:
>
> [emftvm.run] org.eclipse.m2m.atl.emftvm.util.VMException:
> java.lang.NoSuchFieldException: Field void::direction not found

Hmm, did you run the transformation in debug mode? In debug mode¸ the
transformation halts on an exception, and you have to switch to the debug
perspective to see it.


Cheers,
Dennis
Re: [EMFTVM] Comparing enum types [message #1404018 is a reply to message #1403454] Tue, 29 July 2014 07:37 Go to previous message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
Hi Dennis,

No, I was in run mode the whole time.
Previous Topic:Several rules with one sources
Next Topic:[EMFTVM] Incorrect trace model with unique lazy rules
Goto Forum:
  


Current Time: Thu Apr 25 05:08:09 GMT 2024

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

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

Back to the top