0

I'm trying to create a class diagram with some constraints in Visual Paradigm. As far as I found so far VP doesn't support OCL so I'm looking for "the right way" to represent these constraints.

enter image description here

What I'm trying to accomplish is:

context Product
    inv: articleId.size() > 0 implies productId = articleId
    inv: articleId.size() = 0 implies materialId.size() = 8
    inv: articleId.size() = 0 implies productId = materialId
    inv: articleId.size() > 0 implies gtin.size() = 13

How should I model this in UML? (And in Visual Paradigm if you might know it?)

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
Johan Vergeer
  • 5,208
  • 10
  • 48
  • 105

1 Answers1

0

You would just need to enclose the constraints in { braces } within the comment and you're done. OCL or plain text is merely a question of taste if you don't have an OCL compiler.

See also my example.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86