<br><font size=2 face="sans-serif">Until global namespaces are available
you can use temporary associations to get the same effect and this feature
is well tested and supported in GReAT already. </font>
<br>
<br><font size=2 face="sans-serif">What you should do is the following:</font>
<br>
<br><font size=2 face="sans-serif">1. Create a new package called CrossLinks
(the name doesn't really matter).</font>
<br><font size=2 face="sans-serif">2. In the package create a class diagram
called myTemporaryAssociaitons.</font>
<br><font size=2 face="sans-serif">3. In the myTemporaryAssociaitons &nbsp;class
diagram drag a reference of the SrcPart class from the SrcMeta package.
(ctrl+shift drag or copy and right click paste as reference)</font>
<br><font size=2 face="sans-serif">4. Do the same for TgtTypeSystem and
TgtDataStore.</font>
<br><font size=2 face="sans-serif">5. create new simple association types
in between them as you need. In your case there will be one from SrcPart
to TgtTypeSystem (called say srcPart2TypeSystem) and another from SrcPart
to TgtDataStore called say (called say srcPart2DataStore). Please remember
to change the role name so that they are unique. </font>
<br>
<br><font size=2 face="sans-serif">6. Now these new association types that
you have defined can be used in the transformations. They are temporary
and will not surface in your output.</font>
<br>
<br><font size=2 face="sans-serif">7. In the initialize transformation
where you find the SrcPart of interest and create a new DataStore, &nbsp;you
should also create a new association of type srcPart2DataStore. Now you
don't need to pass along the DataStore as it can be retrieved from the
SrcPart by finding the srcPart2DataStore association from it in the subsequent
rule. </font>
<br>
<br><font size=2 face="sans-serif">8. Do the same in the rule where you
create the TypeSystem associated with the part. </font>
<br>
<br><font size=2 face="sans-serif">For examples on how these temporary
cross associations are used please refer to the StateChart example. In
the example the CrossLink package contains the temporary associations and
these are used throughout the transformations.</font>
<br>
<br><font size=2 face="sans-serif">I hope this helps.</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Adi</font>
<br>
<br>
<br><font size=2 face="sans-serif">-----------------------------------<br>
Aditya Agrawal<br>
Researcher<br>
IBM T. J. Watson<br>
mailto:aagrawa@us.ibm.com<br>
+1 (914) 784-6068 (TL 863)<br>
</font>
<br>
<br><font size=2><tt>great-users-bounces@list.isis.vanderbilt.edu wrote
on 04/04/2005 05:40:18 PM:<br>
<br>
&gt; Dear Gurkan,<br>
&gt; <br>
&gt; People often get confused with the packet passing semantics in GReAT.<br>
&gt; The rule of thumb is, that all objects that a rule receives via its
<br>
&gt; input ports, must be supplied by one rule.<br>
&gt; Say you have rule R1 with input ports I1, I2, and you want R0 to <br>
&gt; suppy packets of R1. Then R0 must supply both I1 and I2, and there
<br>
&gt; is no way around this.<br>
&gt; The constraint is strict because of the problems you have been <br>
&gt; groping about: e.g. how to match up the objects from two different
<br>
&gt; rules, how to form the packets.<br>
&gt; This is not trivial, mainly because the order of packets produced
by<br>
&gt; a rule is not deterministic.<br>
&gt; <br>
&gt; Howevere there is panacea for your problems. There is a new feature
<br>
&gt; in the GReAT language, which we called Global namespace.<br>
&gt; You can create a designated UML package model, and create classes
in<br>
&gt; it just like for any ordinary UML class diagram.<br>
&gt; The root class of such a package (i.e. the class which is not <br>
&gt; contained in any other classes) automatically becomes accessible <br>
&gt; inside any rule of your transformation.<br>
&gt; We created this feature for exactly the reason of getting rid of <br>
&gt; passing excess objects through a set of rules.<br>
&gt; <br>
&gt; This feature is ready, but there has been no public release yet, and<br>
&gt; we are still adding many new language features to GReAT.<br>
&gt; If you're willing to use a possibly less reliable and robust tool,
<br>
&gt; we can provide you with an internal GReAT release which contains <br>
&gt; this feature. <br>
&gt; Let me know, what would you like to do.<br>
&gt; <br>
&gt; Thanks,<br>
&gt; Attila<br>
&gt; <br>
&gt; <br>
&gt; &gt; -----Original Message-----<br>
&gt; &gt; From: Gürkan Özhan [mailto:gurkanozhan@gmail.com] <br>
&gt; &gt; Sent: Monday, April 04, 2005 16:07<br>
&gt; &gt; To: great-users<br>
&gt; &gt; Subject: [great-users] Serial vs Parallel execution<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; I have provided a simplified version of my exercise in the <br>
&gt; &gt; attachment. The versions of GME and GReAT are the latest <br>
&gt; &gt; releases, namely, version 4.11.10 for GME and version 1.3.3 <br>
&gt; &gt; for GReAT ( and UDM version is 2.21).<br>
&gt; &gt; <br>
&gt; &gt; I am having difficulting in writing parallel transformation <br>
&gt; &gt; definitions. The problem is, I need to start two parallel <br>
&gt; &gt; branches, construct them independently in their own branches,
<br>
&gt; &gt; but then need to use some parts from both branches in a <br>
&gt; &gt; further rule. I use a block to function as a synchronizer for
<br>
&gt; &gt; the parallel branches, so that inputs from both branches are
<br>
&gt; &gt; available for the rule following the block. Unfortunately I <br>
&gt; &gt; could not succeed in achieving this. The scenario only works
<br>
&gt; &gt; as expected if I carry all the references serially through a
<br>
&gt; &gt; single branch, hence loosing space efficiency and introducing
<br>
&gt; &gt; unnecessary and confusing complexity.<br>
&gt; &gt; <br>
&gt; &gt; I have provided three start rules in the configuration. Of <br>
&gt; &gt; these three, only StartSerial block works successfully, while
<br>
&gt; &gt; StartMoreParallel and StartParallel do not. Details are below:<br>
&gt; &gt; <br>
&gt; &gt; (This is the point where the Initialize block ends in a debug
<br>
&gt; &gt; session. I expect the execution of the next rule, but it does
<br>
&gt; &gt; not execute.)<br>
&gt; &gt; <br>
&gt; &gt; Start Rule Name: StartMoreParallel<br>
&gt; &gt; <br>
&gt; &gt; Snapshot of Debug Step 9 (end of block Initialize):<br>
&gt; &gt; In Variables<br>
&gt; &gt; &nbsp; &nbsp;Tgt_RF<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; has no value<br>
&gt; &gt; &nbsp; &nbsp;Src_Rf <br>
&gt; &gt; &nbsp; &nbsp; &nbsp; has no value<br>
&gt; &gt; Out Variables<br>
&gt; &gt; &nbsp; &nbsp;S_T1_Part<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; NewSrcMain.PartA<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; NewSrcMain.PartB<br>
&gt; &gt; &nbsp; &nbsp;S_T2_Part<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; NewSrcMain.PartC<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; NewSrcMain.PartD<br>
&gt; &gt; &nbsp; &nbsp;T_DataStore<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; TgtMain.TgtDataStore<br>
&gt; &gt; &nbsp; &nbsp;TypeSystem<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; TgtMain.TgtTypeSystem<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; <br>
&gt; &gt; At Debug Step 4 (CreateTgtType1Data(dataStore:I, Part:I, <br>
&gt; &gt; typeSystem:I, type1:P, type1Ref:P, tgtPart1:P)<br>
&gt; &gt; &nbsp; &nbsp;No match and skip :-(<br>
&gt; &gt; At Debug Step 3 (CreateTgtType2Data(dataStore:I, Part:I, <br>
&gt; &gt; typeSystem:I, type2:P, type2Ref:P, tgtPart2:P)<br>
&gt; &gt; &nbsp; &nbsp;No match and skip :-(<br>
&gt; &gt; &nbsp; &nbsp;<br>
&gt; &gt; Eventhough the input ports are provided with matching data, <br>
&gt; &gt; neither CreateTgtType1Data, nor CreateTgtType2Data match and
<br>
&gt; &gt; execute. I thought that a block stacks all of its packets at
<br>
&gt; &gt; its output ports until the last packet is produced, and &nbsp;only
<br>
&gt; &gt; after that,the next rule following the block starts.<br>
&gt; &gt; <br>
&gt; &gt; Also, isn't there a mechaism to make a port repeat its value
<br>
&gt; &gt; n times? Let me explain this with the above example: In our <br>
&gt; &gt; case S_T1_Part has 2 packets, whereas, T_DataStore and <br>
&gt; &gt; TypeSystem have 1 packet. Therefore T_DataStore and <br>
&gt; &gt; TypeSystem should repeat their data as many times as <br>
&gt; &gt; S_T1_Part's packet count(in this case 2 times)<br>
&gt; &gt; <br>
&gt; &gt; A similar scenario is with start block StartParallel. Here we
<br>
&gt; &gt; are stuck after the rule CreateTgtDataStoreAndData. The <br>
&gt; &gt; following rules CreateTgtType1Data and CreateTgtType2Data <br>
&gt; &gt; just don't execute.<br>
&gt; &gt; <br>
&gt; &gt; The transformation only succeeds with the start block <br>
&gt; &gt; StartSerial. In this scenario we carry all the necessary <br>
&gt; &gt; references serially through a single path till the end of <br>
&gt; &gt; CreateTgtDataStoreAndData block. However, this sort of <br>
&gt; &gt; implementation results in unnecessary carrying of packets <br>
&gt; &gt; through previous rules that will be required in some other <br>
&gt; &gt; rule that is farther away. This is really a space efficiency
<br>
&gt; &gt; killer and complicates understanding of the rules in <br>
&gt; &gt; scenarios where the target model is huge and has modular <br>
&gt; &gt; subparts that can be constructed independently, but pieces of
<br>
&gt; &gt; those subparts are used as inputs in some rule that is <br>
&gt; &gt; further away in the rule execution sequence.<br>
&gt; &gt; <br>
&gt; &gt; Thanks in advance.<br>
&gt; &gt; <br>
&gt; &gt; Gürkan Özhan<br>
&gt; &gt; <br>
&gt; _______________________________________________<br>
&gt; great-users mailing list<br>
&gt; great-users@list.isis.vanderbilt.edu<br>
&gt; http://list.isis.vanderbilt.edu/mailman/listinfo/great-users<br>
</tt></font>