<br><font size=2 face="sans-serif">Hmm ok, just tried it again and now
it works, maybe a combination of the generic type resolving mechanism I
just implemented.<br>
</font>
<table>
<tr>
<td valign=top><img src=cid:_1_0867F0E40867ED28002EE939C1257842>
<td><font size=3>&nbsp; </font>
<td><font size=1 face="Verdana"><b>Thomas Goldschmidt </b><br>
<br>
ABB AG<br>
Forschungszentrum<br>
Wallstadter Straße 59<br>
68526 Ladenburg<br>
Office Phone: +49 6203 716134<br>
Office Fax: +49 6203 716253<br>
e-mail:</font><font size=1 color=blue face="Verdana"> thomas.goldschmidt@de.abb.com</font></table>
<br>
<br><font size=1 color=#808080 face="Verdana">ABB AG<br>
Sitz/Head Office: Mannheim <br>
Registergericht/Registry Court: Mannheim<br>
Handelsregisternummer/Commercial Register No.: HRB 4664<br>
Geschäftsführung/Managing Board: Peter Smits (Vorsitzender), Joachim Schneider,
Markus Ochsner, Hans-Georg Krabbe<br>
Vorsitzender des Aufsichtsrats/Chairman of Supervisory Board: Bernhard
Jucker<br>
<br>
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
erhalten haben, informieren Sie bitte sofort den Absender und vernichten
Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe
dieser Mail ist nicht gestattet. <br>
<br>
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any unauthorized
copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Stephan Erb &lt;stephan@dev.static-void.de&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: furcas-discussion-bounces@lists.furcas.org</font>
<p><font size=1 face="sans-serif">25.02.2011 09:26</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">furcas-discussion@lists.furcas.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [furcas-discussion] referenceBy
Use-Case</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hey Thomas,<br>
<br>
I believe that we do already support this usecase:<br>
&gt; referenceBy=&quot;OCL:...anything goes here...&quot;<br>
<br>
Protocol is that the referenceBy expression returns a type covered by a<br>
PrimitiveTemplate. <br>
<br>
We implemented it because in same rare circumstances you need more<br>
complex rules to derive the name of an object, as for example within the<br>
as-Argument of the TCS syntax.<br>
<br>
Best,<br>
Stephan<br>
<br>
On Fri, 2011-02-25 at 09:02 +0100, Thomas Goldschmidt wrote:<br>
&gt; <br>
&gt; Hi, <br>
&gt; <br>
&gt; I think I found a case where the current lookupScope/referenceBy<br>
&gt; handling might not enough: <br>
&gt; <br>
&gt; I have a syntax for the Ecore variant of OCL which is based on<br>
&gt; generics inheriting from a generic OCL metamodel (which is kind of<br>
&gt; ugly in my oppinion). Anyway, there I define a template for<br>
&gt; VariableExp in the fopllowing way: <br>
&gt; <br>
&gt; template &quot;</font></tt><a href=http://www.eclipse.org/ocl/1.1.0/Ecore><tt><font size=2>http://www.eclipse.org/ocl/1.1.0/Ecore&quot;#VariableExp
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; : [[ <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;referredVariable {forcedLower=1,mode=self}
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;referredVariable &nbsp;{as=identifier,
forcedLower=1 ,<br>
&gt; lookupScope = &quot;ocl::ecore::Variable.allInstances()&quot;,<br>
&gt; referenceBy=&quot;name&quot;} <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]] <br>
&gt; <br>
&gt; &nbsp;{{ eType=lookIn(&quot;OCL:self.referredVariable.oclAsType(ocl::ecore::Variable).eType&quot;),
<br>
&gt; <br>
&gt; name=lookIn(&quot;OCL:self.referredVariable.oclAsType(ocl::ecore::Variable).name&quot;)
}} <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; ; <br>
&gt; <br>
&gt; However, this doesn't work as the referenceBy-feature &quot;name&quot;
is<br>
&gt; currently validated against the type of the feature it is intended
to<br>
&gt; set, i.e., referredVariable. In this setting referredVariable is typed<br>
&gt; as &nbsp;Variable&lt;C, PM&gt; &nbsp;from ocl::expressions (which
is the generic part<br>
&gt; of OCL) where the generics are bound as &lt;EClassifier, EParameter&gt;.<br>
&gt; Still there is a concrete subclass of VariableExp in the ocl::ecore<br>
&gt; package defined as follows: Variable -&gt;<br>
&gt; ETypedElement,Variable&lt;EClassifier, EParameter&gt;. This leads
to the<br>
&gt; fact that &quot;name&quot; is only defined on this concrete subclass
(inherited<br>
&gt; from ETypedElement-&gt;ENamedElement). Therefore, the &quot;name&quot;
feature is<br>
&gt; not found when validating the syntax and an error occurs. Still, the<br>
&gt; generic Variable&lt;C, PM&gt; also inherits from the abstract class<br>
&gt; ocl::utilities::TypedElement which defines an operation &quot;getName()&quot;.<br>
&gt; This &quot;coincidence&quot; leads to the fact that on the Java side
this<br>
&gt; &quot;getName()&quot; magically works by resolving to ENamedElement.getName(),<br>
&gt; during OCL evaluation this also works fine if we call operation<br>
&gt; getName() instead of attribute &quot;name&quot;. Therefore, what might
work is<br>
&gt; using the operation in the referenceBy clause: <br>
&gt; <br>
&gt; referenceBy=&quot;getName()&quot; <br>
&gt; <br>
&gt; What do you think? Is this just a weird special case that will never<br>
&gt; occur anywhere else? Or do we need to support this? <br>
&gt; <br>
&gt; Btw: Resolving generics as reference types was not supported in the<br>
&gt; generator, I added this including some test cases and I will push
this<br>
&gt; later today. <br>
&gt; <br>
&gt; Cheers,<br>
&gt; Thomas<br>
&gt; <br>
&gt; &nbsp; <br>
&gt; Thomas Goldschmidt <br>
&gt; <br>
&gt; ABB AG<br>
&gt; Forschungszentrum<br>
&gt; Wallstadter Straße 59<br>
&gt; 68526 Ladenburg<br>
&gt; Office Phone: +49 6203<br>
&gt; 716134<br>
&gt; Office Fax: +49 6203<br>
&gt; 716253<br>
&gt; e-mail:<br>
&gt; thomas.goldschmidt@de.abb.com<br>
&gt; <br>
&gt; <br>
&gt; ABB AG<br>
&gt; Sitz/Head Office: Mannheim <br>
&gt; Registergericht/Registry Court: Mannheim<br>
&gt; Handelsregisternummer/Commercial Register No.: HRB 4664<br>
&gt; Geschäftsführung/Managing Board: Peter Smits (Vorsitzender), Joachim<br>
&gt; Schneider, Markus Ochsner, Hans-Georg Krabbe<br>
&gt; Vorsitzender des Aufsichtsrats/Chairman of Supervisory Board: Bernhard<br>
&gt; Jucker<br>
&gt; <br>
&gt; Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte<br>
&gt; Informationen. Wenn Sie nicht der richtige Adressat sind oder diese<br>
&gt; E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den<br>
&gt; Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie<br>
&gt; die unbefugte Weitergabe dieser Mail ist nicht gestattet. <br>
&gt; <br>
&gt; This e-mail may contain confidential and/or privileged information.
If<br>
&gt; you are not the intended recipient (or have received this e-mail in<br>
&gt; error) please notify the sender immediately and destroy this e-mail.<br>
&gt; Any unauthorized copying, disclosure or distribution of the material<br>
&gt; in this e-mail is strictly forbidden.<br>
&gt; _______________________________________________<br>
&gt; Furcas-discussion mailing list<br>
&gt; Furcas-discussion@lists.furcas.org<br>
&gt; </font></tt><a href="http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion"><tt><font size=2>http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion<br>
<br>
<br>
_______________________________________________<br>
Furcas-discussion mailing list<br>
Furcas-discussion@lists.furcas.org<br>
</font></tt><a href="http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion"><tt><font size=2>http://lists.furcas.org/cgi-bin/mailman/listinfo/furcas-discussion<br>
</font></tt></a></a></a>
<br>