Skip to main content



      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 10:10 Go to next message
Eclipse UserFriend
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 09:41] by Moderator

Re: [QVTo] Running from Java: Adding two models [message #660466 is a reply to message #660455] Fri, 18 March 2011 10:42 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: [QVTo] Running from Java: Adding two models [message #660755 is a reply to message #660466] Mon, 21 March 2011 09:38 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 15:16:57 EDT 2025

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

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

Back to the top