Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a profil
Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a profil [message #1597973] Mon, 02 February 2015 17:47 Go to next message
Eclipse UserFriend
Hi,
I've been working on a test profile and OCL.
However, whenever I use enumerations in OCL and I write in an OCL
something like: self.att = Enumeration1::ONE I get this error:

Description Resource Path Location Type
The 'B::Enumerations not working in OCL' constraint result is invalid
for '«B»model::Class2'
- java.lang.UnsupportedOperationException MyModel.uml /SortingBy
Unknown EMF Problem

I think this bug was reported in
https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604

I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL 5.0.2
and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
get the same error.

On the other hand, I'm tring to write an OCL for a stereotype
(RelationshipC) extending the metaclass Dependency. In this case for
every RelationshipC I would like to check that its attribute Order is
unique for all those dependencies with the stereotype RelationshipC that
share the same source element. If I write this in the Xtext Interactive
console it works perfectly against a model that uses this stereotype:

let orders : Collection(String) =
self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
in
orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
)

However, If I add it to the constraint in the stereotype(just adding
"base_dependency" to make it work in the stereotype as shown below) it
doesn't work as expected.

let orders : Collection(String) =
self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
in
orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
)

Please, find attached a project where both issues can be observed.

Is there an alternative way to achieve this result in an OCL?

Best,

Víctor
  • Attachment: sortedBy.zip
    (Size: 44.92KB, Downloaded 99 times)
Re: Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a pr [message #1598050 is a reply to message #1597973] Mon, 02 February 2015 19:00 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5534
Registered: July 2009
Senior Member
Hi

OCL 5.0.3 has been available for sometime. OCL 5.0.4RC1 is now available
too.

5.0.2 probably does not have the fxes.

Regards

Ed Willink


On 02/02/2015 17:47, "V. López" wrote:
> Hi,
> I've been working on a test profile and OCL.
> However, whenever I use enumerations in OCL and I write in an OCL
> something like: self.att = Enumeration1::ONE I get this error:
>
> Description Resource Path Location Type
> The 'B::Enumerations not working in OCL' constraint result is invalid
> for '«B»model::Class2'
> - java.lang.UnsupportedOperationException MyModel.uml /SortingBy
> Unknown EMF Problem
>
> I think this bug was reported in
> https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604
>
>
> I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL 5.0.2
> and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
> get the same error.
>
> On the other hand, I'm tring to write an OCL for a stereotype
> (RelationshipC) extending the metaclass Dependency. In this case for
> every RelationshipC I would like to check that its attribute Order is
> unique for all those dependencies with the stereotype RelationshipC
> that share the same source element. If I write this in the Xtext
> Interactive console it works perfectly against a model that uses this
> stereotype:
>
> let orders : Collection(String) =
> self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
> in
> orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
> )
>
> However, If I add it to the constraint in the stereotype(just adding
> "base_dependency" to make it work in the stereotype as shown below) it
> doesn't work as expected.
>
> let orders : Collection(String) =
> self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
> in
> orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
> )
>
> Please, find attached a project where both issues can be observed.
>
> Is there an alternative way to achieve this result in an OCL?
>
> Best,
>
> Víctor
>
Re: Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a pr [message #1608308 is a reply to message #1598050] Mon, 09 February 2015 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Dear Ed,

Thanks for your answer, but it still doesn't work.

In the OCL Xtext console:

self.extension_Stereotype1.Attrib1

Results:
profile::Enumeration1::ONE

Then in the profile a write the constraint in the sterotype:

self.Attrib1 = profile::Enumeration1::ONE

I get java.lang.UnsupportedOperationException as noted below.

I add OCL 5.0.3 as a repository in a file and I install everything.
I get the same java.lang.UnsupportedOperationException

I wonder what OCL component is actually Papyrus using.

Best,

Víctor

El 02/02/2015 a las 20:00, Ed Willink escribió:
> Hi
>
> OCL 5.0.3 has been available for sometime. OCL 5.0.4RC1 is now available
> too.
>
> 5.0.2 probably does not have the fxes.
>
> Regards
>
> Ed Willink
>
>
> On 02/02/2015 17:47, "V. López" wrote:
>> Hi,
>> I've been working on a test profile and OCL.
>> However, whenever I use enumerations in OCL and I write in an OCL
>> something like: self.att = Enumeration1::ONE I get this error:
>>
>> Description Resource Path Location Type
>> The 'B::Enumerations not working in OCL' constraint result is invalid
>> for '«B»model::Class2'
>> - java.lang.UnsupportedOperationException MyModel.uml /SortingBy
>> Unknown EMF Problem
>>
>> I think this bug was reported in
>> https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604
>>
>>
>> I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL 5.0.2
>> and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
>> get the same error.
>>
>> On the other hand, I'm tring to write an OCL for a stereotype
>> (RelationshipC) extending the metaclass Dependency. In this case for
>> every RelationshipC I would like to check that its attribute Order is
>> unique for all those dependencies with the stereotype RelationshipC
>> that share the same source element. If I write this in the Xtext
>> Interactive console it works perfectly against a model that uses this
>> stereotype:
>>
>> let orders : Collection(String) =
>> self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>
>> in
>> orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>> )
>>
>> However, If I add it to the constraint in the stereotype(just adding
>> "base_dependency" to make it work in the stereotype as shown below) it
>> doesn't work as expected.
>>
>> let orders : Collection(String) =
>> self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>
>> in
>> orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>> )
>>
>> Please, find attached a project where both issues can be observed.
>>
>> Is there an alternative way to achieve this result in an OCL?
>>
>> Best,
>>
>> Víctor
>>
>
Re: Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a pr [message #1608382 is a reply to message #1608308] Mon, 09 February 2015 13:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5534
Registered: July 2009
Senior Member
Hi

I'll try to have a look once the Luna Modeling SR2 RC2 is available.

Regards

Ed Willink

On 09/02/2015 12:23, "V. López" wrote:
> Dear Ed,
>
> Thanks for your answer, but it still doesn't work.
>
> In the OCL Xtext console:
>
> self.extension_Stereotype1.Attrib1
>
> Results:
> profile::Enumeration1::ONE
>
> Then in the profile a write the constraint in the sterotype:
>
> self.Attrib1 = profile::Enumeration1::ONE
>
> I get java.lang.UnsupportedOperationException as noted below.
>
> I add OCL 5.0.3 as a repository in a file and I install everything.
> I get the same java.lang.UnsupportedOperationException
>
> I wonder what OCL component is actually Papyrus using.
>
> Best,
>
> Víctor
>
> El 02/02/2015 a las 20:00, Ed Willink escribió:
>> Hi
>>
>> OCL 5.0.3 has been available for sometime. OCL 5.0.4RC1 is now available
>> too.
>>
>> 5.0.2 probably does not have the fxes.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 02/02/2015 17:47, "V. López" wrote:
>>> Hi,
>>> I've been working on a test profile and OCL.
>>> However, whenever I use enumerations in OCL and I write in an OCL
>>> something like: self.att = Enumeration1::ONE I get this error:
>>>
>>> Description Resource Path Location Type
>>> The 'B::Enumerations not working in OCL' constraint result is invalid
>>> for '«B»model::Class2'
>>> - java.lang.UnsupportedOperationException MyModel.uml /SortingBy
>>> Unknown EMF Problem
>>>
>>> I think this bug was reported in
>>> https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604
>>>
>>>
>>>
>>> I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL 5.0.2
>>> and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
>>> get the same error.
>>>
>>> On the other hand, I'm tring to write an OCL for a stereotype
>>> (RelationshipC) extending the metaclass Dependency. In this case for
>>> every RelationshipC I would like to check that its attribute Order is
>>> unique for all those dependencies with the stereotype RelationshipC
>>> that share the same source element. If I write this in the Xtext
>>> Interactive console it works perfectly against a model that uses this
>>> stereotype:
>>>
>>> let orders : Collection(String) =
>>> self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>
>>>
>>> in
>>> orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>
>>> )
>>>
>>> However, If I add it to the constraint in the stereotype(just adding
>>> "base_dependency" to make it work in the stereotype as shown below) it
>>> doesn't work as expected.
>>>
>>> let orders : Collection(String) =
>>> self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>
>>>
>>> in
>>> orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>
>>> )
>>>
>>> Please, find attached a project where both issues can be observed.
>>>
>>> Is there an alternative way to achieve this result in an OCL?
>>>
>>> Best,
>>>
>>> Víctor
>>>
>>
>
Re: Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a pr [message #1608558 is a reply to message #1608382] Mon, 09 February 2015 15:50 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Ed.

El 09/02/2015 a las 14:27, Ed Willink escribió:
> Hi
>
> I'll try to have a look once the Luna Modeling SR2 RC2 is available.
>
> Regards
>
> Ed Willink
>
> On 09/02/2015 12:23, "V. López" wrote:
>> Dear Ed,
>>
>> Thanks for your answer, but it still doesn't work.
>>
>> In the OCL Xtext console:
>>
>> self.extension_Stereotype1.Attrib1
>>
>> Results:
>> profile::Enumeration1::ONE
>>
>> Then in the profile a write the constraint in the sterotype:
>>
>> self.Attrib1 = profile::Enumeration1::ONE
>>
>> I get java.lang.UnsupportedOperationException as noted below.
>>
>> I add OCL 5.0.3 as a repository in a file and I install everything.
>> I get the same java.lang.UnsupportedOperationException
>>
>> I wonder what OCL component is actually Papyrus using.
>>
>> Best,
>>
>> Víctor
>>
>> El 02/02/2015 a las 20:00, Ed Willink escribió:
>>> Hi
>>>
>>> OCL 5.0.3 has been available for sometime. OCL 5.0.4RC1 is now available
>>> too.
>>>
>>> 5.0.2 probably does not have the fxes.
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>>
>>> On 02/02/2015 17:47, "V. López" wrote:
>>>> Hi,
>>>> I've been working on a test profile and OCL.
>>>> However, whenever I use enumerations in OCL and I write in an OCL
>>>> something like: self.att = Enumeration1::ONE I get this error:
>>>>
>>>> Description Resource Path Location Type
>>>> The 'B::Enumerations not working in OCL' constraint result is invalid
>>>> for '«B»model::Class2'
>>>> - java.lang.UnsupportedOperationException MyModel.uml /SortingBy
>>>> Unknown EMF Problem
>>>>
>>>> I think this bug was reported in
>>>> https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604
>>>>
>>>>
>>>>
>>>> I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL 5.0.2
>>>> and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
>>>> get the same error.
>>>>
>>>> On the other hand, I'm tring to write an OCL for a stereotype
>>>> (RelationshipC) extending the metaclass Dependency. In this case for
>>>> every RelationshipC I would like to check that its attribute Order is
>>>> unique for all those dependencies with the stereotype RelationshipC
>>>> that share the same source element. If I write this in the Xtext
>>>> Interactive console it works perfectly against a model that uses this
>>>> stereotype:
>>>>
>>>> let orders : Collection(String) =
>>>> self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>
>>>>
>>>> in
>>>> orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>
>>>> )
>>>>
>>>> However, If I add it to the constraint in the stereotype(just adding
>>>> "base_dependency" to make it work in the stereotype as shown below) it
>>>> doesn't work as expected.
>>>>
>>>> let orders : Collection(String) =
>>>> self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>
>>>>
>>>> in
>>>> orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>
>>>> )
>>>>
>>>> Please, find attached a project where both issues can be observed.
>>>>
>>>> Is there an alternative way to achieve this result in an OCL?
>>>>
>>>> Best,
>>>>
>>>> Víctor
>>>>
>>>
>>
>
Re: Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a pr [message #1609649 is a reply to message #1608558] Tue, 10 February 2015 08:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5534
Registered: July 2009
Senior Member
Hi

https://bugs.eclipse.org/bugs/show_bug.cgi?id=459520 raised.

Regards

Ed Willink


On 09/02/2015 15:50, "V. López" wrote:
> Thanks Ed.
>
> El 09/02/2015 a las 14:27, Ed Willink escribió:
>> Hi
>>
>> I'll try to have a look once the Luna Modeling SR2 RC2 is available.
>>
>> Regards
>>
>> Ed Willink
>>
>> On 09/02/2015 12:23, "V. López" wrote:
>>> Dear Ed,
>>>
>>> Thanks for your answer, but it still doesn't work.
>>>
>>> In the OCL Xtext console:
>>>
>>> self.extension_Stereotype1.Attrib1
>>>
>>> Results:
>>> profile::Enumeration1::ONE
>>>
>>> Then in the profile a write the constraint in the sterotype:
>>>
>>> self.Attrib1 = profile::Enumeration1::ONE
>>>
>>> I get java.lang.UnsupportedOperationException as noted below.
>>>
>>> I add OCL 5.0.3 as a repository in a file and I install everything.
>>> I get the same java.lang.UnsupportedOperationException
>>>
>>> I wonder what OCL component is actually Papyrus using.
>>>
>>> Best,
>>>
>>> Víctor
>>>
>>> El 02/02/2015 a las 20:00, Ed Willink escribió:
>>>> Hi
>>>>
>>>> OCL 5.0.3 has been available for sometime. OCL 5.0.4RC1 is now
>>>> available
>>>> too.
>>>>
>>>> 5.0.2 probably does not have the fxes.
>>>>
>>>> Regards
>>>>
>>>> Ed Willink
>>>>
>>>>
>>>> On 02/02/2015 17:47, "V. López" wrote:
>>>>> Hi,
>>>>> I've been working on a test profile and OCL.
>>>>> However, whenever I use enumerations in OCL and I write in an OCL
>>>>> something like: self.att = Enumeration1::ONE I get this error:
>>>>>
>>>>> Description Resource Path Location Type
>>>>> The 'B::Enumerations not working in OCL' constraint result is invalid
>>>>> for '«B»model::Class2'
>>>>> - java.lang.UnsupportedOperationException MyModel.uml /SortingBy
>>>>> Unknown EMF Problem
>>>>>
>>>>> I think this bug was reported in
>>>>> https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL 5.0.2
>>>>> and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
>>>>> get the same error.
>>>>>
>>>>> On the other hand, I'm tring to write an OCL for a stereotype
>>>>> (RelationshipC) extending the metaclass Dependency. In this case for
>>>>> every RelationshipC I would like to check that its attribute Order is
>>>>> unique for all those dependencies with the stereotype RelationshipC
>>>>> that share the same source element. If I write this in the Xtext
>>>>> Interactive console it works perfectly against a model that uses this
>>>>> stereotype:
>>>>>
>>>>> let orders : Collection(String) =
>>>>> self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>
>>>>>
>>>>>
>>>>> in
>>>>> orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>
>>>>>
>>>>> )
>>>>>
>>>>> However, If I add it to the constraint in the stereotype(just adding
>>>>> "base_dependency" to make it work in the stereotype as shown below) it
>>>>> doesn't work as expected.
>>>>>
>>>>> let orders : Collection(String) =
>>>>> self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>
>>>>>
>>>>>
>>>>> in
>>>>> orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>
>>>>>
>>>>> )
>>>>>
>>>>> Please, find attached a project where both issues can be observed.
>>>>>
>>>>> Is there an alternative way to achieve this result in an OCL?
>>>>>
>>>>> Best,
>>>>>
>>>>> Víctor
>>>>>
>>>>
>>>
>>
>
Re: Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a pr [message #1611363 is a reply to message #1609649] Wed, 11 February 2015 10:15 Go to previous message
Eclipse UserFriend
Thanks, I will track the evolution of this bug.

El 10/02/2015 a las 9:49, Ed Willink escribió:
> Hi
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=459520 raised.
>
> Regards
>
> Ed Willink
>
>
> On 09/02/2015 15:50, "V. López" wrote:
>> Thanks Ed.
>>
>> El 09/02/2015 a las 14:27, Ed Willink escribió:
>>> Hi
>>>
>>> I'll try to have a look once the Luna Modeling SR2 RC2 is available.
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>> On 09/02/2015 12:23, "V. López" wrote:
>>>> Dear Ed,
>>>>
>>>> Thanks for your answer, but it still doesn't work.
>>>>
>>>> In the OCL Xtext console:
>>>>
>>>> self.extension_Stereotype1.Attrib1
>>>>
>>>> Results:
>>>> profile::Enumeration1::ONE
>>>>
>>>> Then in the profile a write the constraint in the sterotype:
>>>>
>>>> self.Attrib1 = profile::Enumeration1::ONE
>>>>
>>>> I get java.lang.UnsupportedOperationException as noted below.
>>>>
>>>> I add OCL 5.0.3 as a repository in a file and I install everything.
>>>> I get the same java.lang.UnsupportedOperationException
>>>>
>>>> I wonder what OCL component is actually Papyrus using.
>>>>
>>>> Best,
>>>>
>>>> Víctor
>>>>
>>>> El 02/02/2015 a las 20:00, Ed Willink escribió:
>>>>> Hi
>>>>>
>>>>> OCL 5.0.3 has been available for sometime. OCL 5.0.4RC1 is now
>>>>> available
>>>>> too.
>>>>>
>>>>> 5.0.2 probably does not have the fxes.
>>>>>
>>>>> Regards
>>>>>
>>>>> Ed Willink
>>>>>
>>>>>
>>>>> On 02/02/2015 17:47, "V. López" wrote:
>>>>>> Hi,
>>>>>> I've been working on a test profile and OCL.
>>>>>> However, whenever I use enumerations in OCL and I write in an OCL
>>>>>> something like: self.att = Enumeration1::ONE I get this error:
>>>>>>
>>>>>> Description Resource Path Location Type
>>>>>> The 'B::Enumerations not working in OCL' constraint result is invalid
>>>>>> for '«B»model::Class2'
>>>>>> - java.lang.UnsupportedOperationException MyModel.uml /SortingBy
>>>>>> Unknown EMF Problem
>>>>>>
>>>>>> I think this bug was reported in
>>>>>> https://www.eclipse.org/forums/index.php/m/1457604/?srch=ocl+enumeration#msg_1457604
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I have tested this problem in Eclipse Luna, Papyrus 1.02 and OCL
>>>>>> 5.0.2
>>>>>> and with Eclipse Mars M4, Papyrus 1.1 and OCL 5.1.0. In both cases, I
>>>>>> get the same error.
>>>>>>
>>>>>> On the other hand, I'm tring to write an OCL for a stereotype
>>>>>> (RelationshipC) extending the metaclass Dependency. In this case for
>>>>>> every RelationshipC I would like to check that its attribute Order is
>>>>>> unique for all those dependencies with the stereotype RelationshipC
>>>>>> that share the same source element. If I write this in the Xtext
>>>>>> Interactive console it works perfectly against a model that uses this
>>>>>> stereotype:
>>>>>>
>>>>>> let orders : Collection(String) =
>>>>>> self.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> in
>>>>>> orders->excludes(self.getValue(self.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>>
>>>>>>
>>>>>>
>>>>>> )
>>>>>>
>>>>>> However, If I add it to the constraint in the stereotype(just adding
>>>>>> "base_dependency" to make it work in the stereotype as shown
>>>>>> below) it
>>>>>> doesn't work as expected.
>>>>>>
>>>>>> let orders : Collection(String) =
>>>>>> self.base_Dependency.source.oclAsType(Class).clientDependency()->excluding(self).getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> in
>>>>>> orders->excludes(self.base_Dependency.getValue(self.base_Dependency.getApplicableStereotype('Test::RelationshipC'),'Order').toString().trim()
>>>>>>
>>>>>>
>>>>>>
>>>>>> )
>>>>>>
>>>>>> Please, find attached a project where both issues can be observed.
>>>>>>
>>>>>> Is there an alternative way to achieve this result in an OCL?
>>>>>>
>>>>>> Best,
>>>>>>
>>>>>> Víctor
>>>>>>
>>>>>
>>>>
>>>
>>
>
Previous Topic:Unable to validate OCL
Next Topic:Knowing what diagram an element belongs to in OCL
Goto Forum:
  


Current Time: Sat Dec 16 01:38:37 GMT 2017

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

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