[QVTo] Mapping that needs to modify initial Model [message #1702611] |
Thu, 23 July 2015 14:00 |
João Bastos Messages: 9 Registered: September 2014 |
Junior Member |
|
|
Hi,
First of all, I am quite new to QVTo and probably this was already answered or I can find it in some literature. However, I also seem to lack the knowledge to know what to look for. So if you have another topic or a link, would be great as well.
My problem is quite simple to explain.
I want to transform a metamodel A (of a graph structure) to a metamodel B (also a graph structure). Everything is very straighfoward except for one final transformation I want to make.
Both Metamodels have a basic of tasks and dependencies. However, from Metamodel A to B I want to make new dependencies between tasks.
I have two mappings
tasksB += self.tasksA.xmap taskA2TaskB();
dependenciesB += self.allSubobjectsOfType(Dependency)[Dependency].dependencyA2DependencyB();
These two are enough to convert from graph A to graph B. However, I wanted to know if I could while doing a mapping from taskA2TaskB also generate dependencies? Is that not possible ? Multiple outputs of a mapping?
I also tried making a second mapping function that maps from TasksA but now creates not TasksB but DependenciesB. However, this created as many dependencies as there are channels (obviously). So I tried to apply a when:
mapping Task::specialTaskA2DependencyB() : DependencyB when {self.name.startsWith("special")} {
But this gives me an error saying that:
Precondition failed in mapping 'specialTaskA2DependencyB'
And the details do not help at all understanding why this error.
I am a bit lost already in Tutorials and Presentations of QVTo, but it felt it could be easier to ask for some help or tips.
Thank you in advance,
Joao
|
|
|
|
Powered by
FUDForum. Page generated in 0.02958 seconds