Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Extension of the standard library
Extension of the standard library [message #64114] Tue, 04 November 2008 09:51 Go to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060303020002080409030408
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Christian,


I managed to extend the standard library and added custom operations to
OCL during the development of MTL. For this, I defined a model really
close to what you did with oclstdlib.ecore and OCLStandardLibrary.java.
The implementation of these custom operations is in the
EvaluationEnvironment where I overrode CallOperation.

What I did not manage to do though, was to create a custom operation
which would return a typed sequence : my best try returned a
"Sequence(T)". This forces me to use "oclAsType" after each invocation
to accurately type the sequence.

The operation I defined is a "typed" eAllContents for EObject in order
to retrieve only the elements of a given type in the content tree of an
element : "eAllContents(EClassifier) : Sequence(T)". Obviously, the type
of the sequence content is known (EClassifier). Is there any way to
force the OCL parser to type that sequence without a subsequent call to
oclAsType?

laurent Goubet
Obeo

--------------060303020002080409030408
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------060303020002080409030408--
Re: Extension of the standard library [message #64138 is a reply to message #64114] Tue, 04 November 2008 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Laurent,

I think that a solution for your problem is on the plan for the 1.3
release. See https://bugs.eclipse.org/179990 for details.

HTH,

Christian

laurent Goubet wrote:
> Hi Christian,
>
>
> I managed to extend the standard library and added custom operations to
> OCL during the development of MTL. For this, I defined a model really
> close to what you did with oclstdlib.ecore and OCLStandardLibrary.java.
> The implementation of these custom operations is in the
> EvaluationEnvironment where I overrode CallOperation.
>
> What I did not manage to do though, was to create a custom operation
> which would return a typed sequence : my best try returned a
> "Sequence(T)". This forces me to use "oclAsType" after each invocation
> to accurately type the sequence.
>
> The operation I defined is a "typed" eAllContents for EObject in order
> to retrieve only the elements of a given type in the content tree of an
> element : "eAllContents(EClassifier) : Sequence(T)". Obviously, the type
> of the sequence content is known (EClassifier). Is there any way to
> force the OCL parser to type that sequence without a subsequent call to
> oclAsType?
>
> laurent Goubet
> Obeo
Re: Extension of the standard library [message #64185 is a reply to message #64138] Tue, 04 November 2008 14:48 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070109010701020002080808
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Christian,

Yep, seems like the same as mine, thanks and sorry for not searching ;).

Laurent Goubet
Obeo

Christian W. Damus a
Re: Extension of the standard library [message #64214 is a reply to message #64185] Tue, 04 November 2008 14:57 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Laurent,

No problem. It's nice to have more requestees on board to motivate this
enhancement. :-D

cW

laurent Goubet wrote:
> Christian,
>
> Yep, seems like the same as mine, thanks and sorry for not searching ;).
>
> Laurent Goubet
> Obeo
>
> Christian W. Damus a écrit :
>> Hi, Laurent,
>>
>> I think that a solution for your problem is on the plan for the 1.3
>> release. See https://bugs.eclipse.org/179990 for details.
>>
>> HTH,
>>
>> Christian
>>
>> laurent Goubet wrote:
>>> Hi Christian,
>>>
>>>
>>> I managed to extend the standard library and added custom operations
>>> to OCL during the development of MTL. For this, I defined a model
>>> really close to what you did with oclstdlib.ecore and
>>> OCLStandardLibrary.java. The implementation of these custom
>>> operations is in the EvaluationEnvironment where I overrode
>>> CallOperation.
>>>
>>> What I did not manage to do though, was to create a custom operation
>>> which would return a typed sequence : my best try returned a
>>> "Sequence(T)". This forces me to use "oclAsType" after each
>>> invocation to accurately type the sequence.
>>>
>>> The operation I defined is a "typed" eAllContents for EObject in
>>> order to retrieve only the elements of a given type in the content
>>> tree of an element : "eAllContents(EClassifier) : Sequence(T)".
>>> Obviously, the type of the sequence content is known (EClassifier).
>>> Is there any way to force the OCL parser to type that sequence
>>> without a subsequent call to oclAsType?
>>>
>>> laurent Goubet
>>> Obeo
>
Previous Topic:[Announce] MDT OCL 1.3.0 I200811021527 is available
Next Topic:[Announce] MDT OCL 1.3.0M3 is available
Goto Forum:
  


Current Time: Sun Nov 23 21:33:01 GMT 2014

Powered by FUDForum. Page generated in 0.03308 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software