Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] Running from Java: Adding two models [SOLVED]
[QVTo] Running from Java: Adding two models [SOLVED] [message #660455] Fri, 18 March 2011 14:10 Go to next message
Haffi is currently offline HaffiFriend
Messages: 39
Registered: November 2010
Member
Hi,

I'm running a transformation from Java according to this example, however I want to send two models to the transformation. I've already tried to add the objects manually to the inObjects list via the addAll method and it looks fine when I look at the variable in debug mode, but I still always get the same error:
Diagnostic ERROR source=org.eclipse.m2m.qvt.oml.execution code=140 Invalid number of model parameters. Received (1), expected (2) data=[]


Any ideas?

[Updated on: Mon, 21 March 2011 13:41]

Report message to a moderator

Re: [QVTo] Running from Java: Adding two models [message #660466 is a reply to message #660455] Fri, 18 March 2011 14:42 Go to previous messageGo to next message
Fabio L. S. is currently offline Fabio L. S.Friend
Messages: 15
Registered: July 2010
Location: Brazil
Junior Member
Hi Haffi;

I use two models as input in a transformation, called programmatically. To have more than one input models it is necessary to create another ModelExtent object and pass it to the execute method in ExecutionContextImpl (this method uses varargs). Here is an example:

ModelExtent input1 = new BasicModelExtent(model1.getContents());
ModelExtent input2 = new BasicModelExtent(model2.getContents());
ModelExtent output = new BasicModelExtent();

ExecutionContextImpl context = new ExecutionContextImpl();
ExecutionDiagnostic result = executor.execute(context, input1, input2, output);

I hope it helps.

Regards;
Fabio L. S.


Fabio Levy Siqueira
Re: [QVTo] Running from Java: Adding two models [message #660755 is a reply to message #660466] Mon, 21 March 2011 13:38 Go to previous message
Haffi is currently offline HaffiFriend
Messages: 39
Registered: November 2010
Member
Yes, this is exactly it. I had read the Javadoc to all other methods except this one, don't know why I left that out...
Previous Topic:[Xtend] Creation of associations (ClassCastException)
Next Topic:[QVTo] Removing an element
Goto Forum:
  


Current Time: Sat Apr 20 05:08:46 GMT 2024

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

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

Back to the top