Thanks Joe!<br>Money might not directly be at stake here but time is...But don't worry I'm already getting my time back with your help. <br>Thanks again,<br>Leonard<br><br><div class="gmail_quote">2012/3/14 Joe Porter <span dir="ltr"><<a href="mailto:joe.porter@gmail.com">joe.porter@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Leonard,<br>
<br>
This is not a problem - GReAT is great for this sort of thing (sorry<br>
for the bad pun). Here is what I would do in the transformation:<br>
<br>
Rule M: Visit all of the ModPart objects, match one ModPin connected<br>
as source to a Connect object and create an OutFlowPort in the target<br>
model. Translate attributes and create a CrossLink from the ModPin<br>
object to the newly created target model Port. The CrossLink must be<br>
defined between a ModPort and an OutFlowPort.<br>
Rule N: Do the same, but match ModPin connected as destination to a<br>
Connect object. Create an InFlowPort and a cross link from the ModPin<br>
to the InFlowPort.<br>
Rule O: Visit all of the ModPart objects, match ModInFlow and create<br>
the right kind of Port in the target model. Translate attributes and<br>
create a CrossLink.<br>
Rule P: Do the same for ModPart, ModOutFlow.<br>
Rule Q: Do the same for ModBlock, ModInFlow.<br>
Rule R: Do the same for ModBlock, ModOutFlow.<br>
<br>
It will be easiest to specify that GReAT handle all of these rules in<br>
parallel. Just fan out the connections from the output ports of the<br>
previous rule to all of the input ports of these rules.<br>
<br>
Once you have the ports created and the CrossLinks, it's time to<br>
create the connections. You will need one rule for each type of<br>
connection you need to create in the target model.<br>
<br>
Rule S: Match the Connect type and the ports it attaches to, along<br>
with the CrossLinked ports in the target model. Create the<br>
corresponding FlowSpecification connection in the target model between<br>
the CrossLinked target ports. Add a guard to make sure you create<br>
FlowSpecification for the right things. Make sure the new<br>
FlowSpecification is a child of the proper SysMLBDD object.<br>
<br>
You can aggregate the output ports from all of the Rules M-R into the<br>
input ports of rule S. That should create the whole model you showed<br>
in the example.<br>
<br>
Note that if you have nothing connected to a ModPin, it will be<br>
impossible to tell whether to create the corresponding target port as<br>
InFlowPort or OutFlowPort unless you have more data somewhere.<br>
<br>
If you have problems with any of that then we may need to expand some<br>
of the base types, but I think it will work as expected. The usual<br>
disclaimers apply about missing important details. You may have to<br>
adapt a few of the steps as you get into it. The problem with free<br>
help is that you can't get your money back if it's no good ;-)<br>
<br>
-Joe<br>
<br>
2012/3/12 Léonard PETNGA <<a href="mailto:lpetnga@gmail.com">lpetnga@gmail.com</a>>:<br>
<div class="im HOEnZb">> Hi Joe!<br>
> I have no doubt that a single model component (thus, single type)<br>
> transformation can work but my input model (see a simplified view in<br>
> attachment) contains components from both types. As you can see it has 2<br>
> MobBlock, 4 ModParts and one equation (ModelEquation). Each block and part<br>
> has its own equation (not seen) and various numbers interconnected ports<br>
> from different types. It's consistent with the Metamodel and it's what I<br>
> have to transform now. I want to build a transformation that can handle this<br>
> level of complexity and higher from the input model and, of course, a lower<br>
> level of complexity as the one you mentioned. The issue of unique<br>
> identification of of metamodel elements (see my email below and the screen<br>
> capture attached) is capital when having multiple type of components. I<br>
> really need to know if GREAT can handle this and how. I’ll also welcome any<br>
> workaround strategy.<br>
><br>
> Thanks,<br>
><br>
> Leonard<br>
><br>
><br>
><br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
great-users mailing list<br>
<a href="mailto:great-users@list.isis.vanderbilt.edu">great-users@list.isis.vanderbilt.edu</a><br>
<a href="http://list.isis.vanderbilt.edu/mailman/listinfo/great-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/great-users</a><br>
</div></div></blockquote></div><br>