Re: A question on OCL
On Thu, Dec 18, 2008 at 9:35 AM, Arnon Sturm <email@example.com> wrote:
> I wonder whether it is possible to specify an OCL constraint on two or more
> model elements which do not have a navigation path among them.
You can use allInstances on the classes of those model elements, and
compare attribute values of iterators (in forAll, exists expressions)
or those of tuple elements (when using an OCL 2 product). Perhaps you
can send a class diagram of the concrete data structure you have in
> For example, in case of a library system we have two "unrelated" classes:
> item and person.
> I would like to specify the follwoing constraint: if the items of a
> particular system are all of type 'journal' or 'proceeding', then all the
> persons in this system are of type 'faculty'.
To me, it seems like in your example there actually *is* a path, since
the ``system'' concept aggregates both items and persons. Especially,
since you mention a ``particular'' system, I presume you are thinking
of having several ``system'' instances and therefore an explicit class
related to that system concept.
Pieter Van Gorp
Assistant Professor (Universitair Docent)
Information Systems Group
School of Industrial Engineering
Eindhoven University of Technology (TU/e)
P.O. Box 513, 5600 MB Eindhoven
Phone: +31 40 247 2062
Skype ID: pvgorp
Fax: +31 40 243 2612
Received on Thu 18 Dec 2008 - 09:11:21 GMT