Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Adding new operations to the String primitive datatype
Adding new operations to the String primitive datatype [message #53056] Fri, 21 March 2008 21:07 Go to next message
Juan Cadavid is currently offline Juan CadavidFriend
Messages: 59
Registered: July 2009
Location: Paris, France
Member

Hi OCL team!

I'm a new user of the QVTO component, and there's a question I have about
their OCL implementation, which I understand, is made by you guys.

I have a comma-separated string and I need to split it. From the spec, I
can see that the operations supported by the String datatype are size(),
concat(), substring(), toInteger() and toReal(), but there's no split()
operation. Is there a way to extend the plug-in to add new operations to
the String datatype? I'm truly illiterate on OCL so I'd be extremely
thankful if you could point me in the right direction. Thank you very much!

-Juan
Re: Adding new operations to the String primitive datatype [message #53163 is a reply to message #53056] Mon, 24 March 2008 15:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Juan,

Yes, there is a way to do this.

Follow the example that adds a "regexMatch" operation to the String type in
the "Customizing the Environment" topic (under "Advanced Topics") in the
OCL SDK's developer guide in the on-line help. This illustrates how to
implement new operations in Java, for cases that would be too difficult or
impossible with OCL.

For operations that can be defined using OCL, the standard def: expression
syntax is supported.

HTH,

Christian


Juan Jose Cadavid G wrote:

> Hi OCL team!
>
> I'm a new user of the QVTO component, and there's a question I have about
> their OCL implementation, which I understand, is made by you guys.
>
> I have a comma-separated string and I need to split it. From the spec, I
> can see that the operations supported by the String datatype are size(),
> concat(), substring(), toInteger() and toReal(), but there's no split()
> operation. Is there a way to extend the plug-in to add new operations to
> the String datatype? I'm truly illiterate on OCL so I'd be extremely
> thankful if you could point me in the right direction. Thank you very
> much!
>
> -Juan
Re: Adding new operations to the String primitive datatype [message #53214 is a reply to message #53163] Tue, 25 March 2008 12:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Alexander.Igdalov.borland.com

Hi Christian,

Although the what you mention works fine with OCL, currently QVTO which
internally uses the same approach must be extended in a different way.
See news://news.eclipse.org:119/fsap7g$r5a$1@build.eclipse.org

Regards,
Alex.

Christian W. Damus wrote:
> Hi, Juan,
>
> Yes, there is a way to do this.
>
> Follow the example that adds a "regexMatch" operation to the String type in
> the "Customizing the Environment" topic (under "Advanced Topics") in the
> OCL SDK's developer guide in the on-line help. This illustrates how to
> implement new operations in Java, for cases that would be too difficult or
> impossible with OCL.
>
> For operations that can be defined using OCL, the standard def: expression
> syntax is supported.
>
> HTH,
>
> Christian
>
>
> Juan Jose Cadavid G wrote:
>
>> Hi OCL team!
>>
>> I'm a new user of the QVTO component, and there's a question I have about
>> their OCL implementation, which I understand, is made by you guys.
>>
>> I have a comma-separated string and I need to split it. From the spec, I
>> can see that the operations supported by the String datatype are size(),
>> concat(), substring(), toInteger() and toReal(), but there's no split()
>> operation. Is there a way to extend the plug-in to add new operations to
>> the String datatype? I'm truly illiterate on OCL so I'd be extremely
>> thankful if you could point me in the right direction. Thank you very
>> much!
>>
>> -Juan
>
Re: Adding new operations to the String primitive datatype [message #53240 is a reply to message #53214] Tue, 25 March 2008 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Thanks, Alex,

That's good to know. However, your link didn't work for my newsreader; it
gets a "430 No such article" error.

Can you provide a different way to link to this article?

Thanks,

Christian

Alexander Igdalov wrote:

> Hi Christian,
>
> Although the what you mention works fine with OCL, currently QVTO which
> internally uses the same approach must be extended in a different way.
> See news://news.eclipse.org:119/fsap7g$r5a$1@build.eclipse.org
>
> Regards,
> Alex.
>
> Christian W. Damus wrote:
>> Hi, Juan,
>>
>> Yes, there is a way to do this.
>>
>> Follow the example that adds a "regexMatch" operation to the String type
>> in the "Customizing the Environment" topic (under "Advanced Topics") in
>> the
>> OCL SDK's developer guide in the on-line help. This illustrates how to
>> implement new operations in Java, for cases that would be too difficult
>> or impossible with OCL.
>>
>> For operations that can be defined using OCL, the standard def:
>> expression syntax is supported.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Juan Jose Cadavid G wrote:
>>
>>> Hi OCL team!
>>>
>>> I'm a new user of the QVTO component, and there's a question I have
>>> about their OCL implementation, which I understand, is made by you guys.
>>>
>>> I have a comma-separated string and I need to split it. From the spec, I
>>> can see that the operations supported by the String datatype are size(),
>>> concat(), substring(), toInteger() and toReal(), but there's no split()
>>> operation. Is there a way to extend the plug-in to add new operations to
>>> the String datatype? I'm truly illiterate on OCL so I'd be extremely
>>> thankful if you could point me in the right direction. Thank you very
>>> much!
>>>
>>> -Juan
>>
Re: Adding new operations to the String primitive datatype [message #53325 is a reply to message #53240] Wed, 26 March 2008 09:23 Go to previous message
Eclipse UserFriend
Originally posted by: Alexander.Igdalov.borland.com

Hi Christian,

Sorry for the bad link. Try the HTTP version:
http://www.eclipse.org/newsportal/article.php?id=2390&gr oup=eclipse.modeling.m2m#2390


Cheers,
Alex.

Christian W. Damus wrote:
> Thanks, Alex,
>
> That's good to know. However, your link didn't work for my newsreader; it
> gets a "430 No such article" error.
>
> Can you provide a different way to link to this article?
>
> Thanks,
>
> Christian
>
> Alexander Igdalov wrote:
>
>> Hi Christian,
>>
>> Although the what you mention works fine with OCL, currently QVTO which
>> internally uses the same approach must be extended in a different way.
>> See news://news.eclipse.org:119/fsap7g$r5a$1@build.eclipse.org
>>
>> Regards,
>> Alex.
>>
>> Christian W. Damus wrote:
>>> Hi, Juan,
>>>
>>> Yes, there is a way to do this.
>>>
>>> Follow the example that adds a "regexMatch" operation to the String type
>>> in the "Customizing the Environment" topic (under "Advanced Topics") in
>>> the
>>> OCL SDK's developer guide in the on-line help. This illustrates how to
>>> implement new operations in Java, for cases that would be too difficult
>>> or impossible with OCL.
>>>
>>> For operations that can be defined using OCL, the standard def:
>>> expression syntax is supported.
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>>
>>> Juan Jose Cadavid G wrote:
>>>
>>>> Hi OCL team!
>>>>
>>>> I'm a new user of the QVTO component, and there's a question I have
>>>> about their OCL implementation, which I understand, is made by you guys.
>>>>
>>>> I have a comma-separated string and I need to split it. From the spec, I
>>>> can see that the operations supported by the String datatype are size(),
>>>> concat(), substring(), toInteger() and toReal(), but there's no split()
>>>> operation. Is there a way to extend the plug-in to add new operations to
>>>> the String datatype? I'm truly illiterate on OCL so I'd be extremely
>>>> thankful if you could point me in the right direction. Thank you very
>>>> much!
>>>>
>>>> -Juan
>
Previous Topic:Re: installation problem on 3.3.1.1
Next Topic:[Announce] MDT OCL 1.2.0 I200803191800 is available
Goto Forum:
  


Current Time: Wed Apr 24 20:56:07 GMT 2024

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

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

Back to the top