Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsOCL XOR link constraint
https://www.eclipse.org/forums/index.php/mv/msg/199294/635794/#msg_635794
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.
thanks]]>Ra2010-10-28T07:48:51-00:00Re: OCL link constraint
https://www.eclipse.org/forums/index.php/mv/msg/199294/635939/#msg_635939
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:
>]]>Ed Willink2010-10-28T16:01:37-00:00