Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL XOR link constraint
OCL XOR link constraint [message #635794] Thu, 28 October 2010 07:48 Go to next message
Ra is currently offline RaFriend
Messages: 1
Registered: October 2010
Location: spain
Junior Member

We're developing a tool to model the Feature metamodel of Software
Product Lines using GMF. A Feature model allows us to specify
requirements of a product-line in terms of optional/mandatory
features (i.e. a requirement or a set of requirements that are
optional or mandatory when the product-line is derived in a particular application).
The metamodel has an abstract Feature class, of which inherits 2 subtypes of features: SolitaryFeature and GroupedFeature.
There are two association relationship between the Feature class
and the SolitaryFeature that define the relations:

- a Feature /has_optional/ SolitaryFeature,
- a Feature /has_mandatory/ SolitaryFeature.

We need an OCL constraint to define a XOR between these two
relations. The OCL we have implemented is placed in the TARGET END CONSTRAINT INTO A OUR LINK CONSTRAINT (has_optional and has_mandatory). The OCL is the following:
"(oppositeEnd.has_optional=oppositeEnd.has_mandatory)"
The problem to solve is that the OCL constraint involves the
abstract Feature class in such a way that:
a SolitaryFeature1 only can be related with an optional or mandatory
relation with other SolitaryFeature2, but the constraint also
affects to a SolitaryFeature3, in such a way that SolitaryFeature1
cannot be related neither through a optional relation nor a
mandatory relation.


diagram:
http://picasaweb.google.es/108058820701013776061/Desktop#553 2698820872976066


thanks

[Updated on: Fri, 29 October 2010 07:47]

Report message to a moderator

Re: OCL link constraint [message #635939 is a reply to message #635794] Thu, 28 October 2010 16:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Ra

It looks as if half your message got lost.

Ed

On 28/10/2010 08:48, Ra wrote:
> We're developing a tool to model the Feature metamodel of Software
> Product Lines using GMF. A Feature model allows us to specify
> requirements of a product-line in terms of optional/mandatory
> features (i.e. a requirement or a set of requirements that are
> optional or mandatory when the product-line is derived in a particular
> application). The metamodel has an abstract Feature class, of which
> inherits 2 subtypes of features: SolitaryFeature and GroupedFeature.
> There are two association relationship between the Feature class
> and the SolitaryFeature that define the relations:
>
> - a Feature /has_optional/ SolitaryFeature,
> - a Feature /has_mandatory/ SolitaryFeature.
>
> We need an OCL constraint to define a XOR between these two
> relations. The OCL we have implemented is placed in the TARGET END
> CONSTRAINT INTO A OUR LINK CONSTRAINT (has_optional and
> has_mandatory). The OCL is the following:
> "(oppositeEnd.has_optional=oppositeEnd.has_mandatory)"
> The problem to solve is that the OCL constraint involves the
> abstract Feature class in such a way that:
> a SolitaryFeature1 only can be related with an optional or mandatory
> relation with other SolitaryFeature2, but the constraint also
> affects to a SolitaryFeature3, in such a way that SolitaryFeature1
> cannot be related neither through a optional relation nor a
> mandatory relation.
>
> diagram:
>
Previous Topic:How to use EType "Sequence"
Next Topic:OCL Constraint: No two diagram elements can have the same name
Goto Forum:
  


Current Time: Thu Apr 25 07:59:13 GMT 2024

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

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

Back to the top