Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATLLauncher and ATL Virtual Machine(Problem launching ATL transformations from Java but not from Eclipse)
ATLLauncher and ATL Virtual Machine [message #869701] Thu, 03 May 2012 22:01 Go to next message
Javier de la Dehesa is currently offline Javier de la Dehesa
Messages: 4
Registered: February 2012
Junior Member
Hi everybody,

I'm not ATL expert, but I have a couple of ATL transformations that I need to use within the plugin I'm developing. After some research, I found out how to launch ATL transformations from Java with the following code
AtlLauncher.getDefault().launch(transformationUrl,
                Collections.EMPTY_MAP, models, Collections.EMPTY_MAP,
                Collections.EMPTY_LIST, Collections.EMPTY_MAP);

With appropiate values for transformationUrl and models. This has been working fine but I found and example where it failed with
The 'no null' constraint is violated

The thing is that the same transformation launched from Eclipse (with an ATL launch configuration) works correctly. After some try & error I found out that I received the same error from ATL launch configuration if I selected, in "Advanced parameters", "Regular VM" as ATL virtual machine instead of the default "EMF-specific VM".

I don't understand what it exactly means, but I guess that AtlLauncher uses this configuration and there is no way to use that "EMF-specific VM", am I right?

My second discovery was that the line that was causing the error is something like this (real names are a little bit different, just to simplify):
rule SimpleOper {
	from
		input : mast!Simple_Operation
	to 
		output1 : xml!Element (
			name <- 'mast_mdl:Simple_Operation',
			-- if I comment the next line everything works
			children <- if not input.Parameters.oclIsUndefined() then input.Parameters else OclUndefined endif,
			children <- output2
--			parent <- 
		),
		output2 : xml!Attribute (
			name <- 'Name',
			value <- input.Name,
			parent <- output1
		)
	do {
		-- stuff...
	}	
}

So maybe this "Regular VM" is raising an error because I'm trying to use an operation (oclIsUndefined) with an object that does not exist? Even if the operation aims to check if it exists?

I know it's all a bit confusing, but any insight would be really appreciated.

Thanks.
Re: ATLLauncher and ATL Virtual Machine [message #869740 is a reply to message #869701] Fri, 04 May 2012 07:17 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
Try a Sequence{} instead of OclUndefined
Re: ATLLauncher and ATL Virtual Machine [message #869767 is a reply to message #869740] Fri, 04 May 2012 09:18 Go to previous message
Javier de la Dehesa is currently offline Javier de la Dehesa
Messages: 4
Registered: February 2012
Junior Member
Perfect! I changed the conflictive line to
children <- if not input.Parameters.oclIsUndefined() then input.Parameters else Sequence{} endif

and it works now.

Huge thanks, you made my day.
Previous Topic:Can a QVT script transforms a Papyrus's model ?
Next Topic:Model contains "definitions", Ecore specifies "Definition"
Goto Forum:
  


Current Time: Fri Oct 24 12:53:19 GMT 2014

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

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