Conceptual model with a constraint

78 views Asked by At

I'm trying to make a conceptual model of this use case:

The Actor can modify the budget but after the modification the sum of all the budget elements percentages must be 100% or 0% if there are no elements in the budget.

How can I include this constraint in my model? enter image description here
The model can also be found here

2

There are 2 answers

0
Jim L. On BEST ANSWER

You should just put a constraint on the contains property. In MagicDraw one can show the label for a constraint or the actual constraint in OCL.

Here is an example with the label only, which is probably more appropriate for the audience of a conceptual model:

enter image description here

Here is an example with OCL:

enter image description here

A little less readable, eh?

0
qwerty_so On

Simply attach the constraint like this to Budget

enter image description here

You can simply use a Note and put the constraint in curly brackets if your tool does not provide a native constraint element.