<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> </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 <stephan@dev.static-void.de></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>
> referenceBy="OCL:...anything goes here..."<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>
> <br>
> Hi, <br>
> <br>
> I think I found a case where the current lookupScope/referenceBy<br>
> handling might not enough: <br>
> <br>
> I have a syntax for the Ecore variant of OCL which is based on<br>
> generics inheriting from a generic OCL metamodel (which is kind of<br>
> ugly in my oppinion). Anyway, there I define a template for<br>
> VariableExp in the fopllowing way: <br>
> <br>
> template "</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"#VariableExp
<br>
> : [[ <br>
> referredVariable {forcedLower=1,mode=self}
<br>
> | <br>
> referredVariable {as=identifier,
forcedLower=1 ,<br>
> lookupScope = "ocl::ecore::Variable.allInstances()",<br>
> referenceBy="name"} <br>
> ]] <br>
> <br>
> {{ eType=lookIn("OCL:self.referredVariable.oclAsType(ocl::ecore::Variable).eType"),
<br>
> <br>
> name=lookIn("OCL:self.referredVariable.oclAsType(ocl::ecore::Variable).name")
}} <br>
> ; <br>
> <br>
> However, this doesn't work as the referenceBy-feature "name"
is<br>
> currently validated against the type of the feature it is intended
to<br>
> set, i.e., referredVariable. In this setting referredVariable is typed<br>
> as Variable<C, PM> from ocl::expressions (which
is the generic part<br>
> of OCL) where the generics are bound as <EClassifier, EParameter>.<br>
> Still there is a concrete subclass of VariableExp in the ocl::ecore<br>
> package defined as follows: Variable -><br>
> ETypedElement,Variable<EClassifier, EParameter>. This leads
to the<br>
> fact that "name" is only defined on this concrete subclass
(inherited<br>
> from ETypedElement->ENamedElement). Therefore, the "name"
feature is<br>
> not found when validating the syntax and an error occurs. Still, the<br>
> generic Variable<C, PM> also inherits from the abstract class<br>
> ocl::utilities::TypedElement which defines an operation "getName()".<br>
> This "coincidence" leads to the fact that on the Java side
this<br>
> "getName()" magically works by resolving to ENamedElement.getName(),<br>
> during OCL evaluation this also works fine if we call operation<br>
> getName() instead of attribute "name". Therefore, what might
work is<br>
> using the operation in the referenceBy clause: <br>
> <br>
> referenceBy="getName()" <br>
> <br>
> What do you think? Is this just a weird special case that will never<br>
> occur anywhere else? Or do we need to support this? <br>
> <br>
> Btw: Resolving generics as reference types was not supported in the<br>
> generator, I added this including some test cases and I will push
this<br>
> later today. <br>
> <br>
> Cheers,<br>
> Thomas<br>
> <br>
> <br>
> Thomas Goldschmidt <br>
> <br>
> ABB AG<br>
> Forschungszentrum<br>
> Wallstadter Straße 59<br>
> 68526 Ladenburg<br>
> Office Phone: +49 6203<br>
> 716134<br>
> Office Fax: +49 6203<br>
> 716253<br>
> e-mail:<br>
> thomas.goldschmidt@de.abb.com<br>
> <br>
> <br>
> 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<br>
> Schneider, Markus Ochsner, Hans-Georg Krabbe<br>
> Vorsitzender des Aufsichtsrats/Chairman of Supervisory Board: Bernhard<br>
> Jucker<br>
> <br>
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte<br>
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese<br>
> E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den<br>
> Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie<br>
> die unbefugte Weitergabe dieser Mail ist nicht gestattet. <br>
> <br>
> This e-mail may contain confidential and/or privileged information.
If<br>
> you are not the intended recipient (or have received this e-mail in<br>
> error) please notify the sender immediately and destroy this e-mail.<br>
> Any unauthorized copying, disclosure or distribution of the material<br>
> in this e-mail is strictly forbidden.<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>
<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>