IBM Support

Automatically setting links for objects with multiplicity

Question & Answer


Question

I have an object with multiplicity 2. This class has an associations with other 2 classes.
However, when I am setting links between them its not functional. when I am trying to setup links like below, the links are getting overwritten with last pointed association.
For Example:
Class B with object[2] has association with class C named itsclassC.
Class C has its own 2 parts itsC1 and itsC2.
However in link diagram when I try :
object[0]->itsClassC = itsC1 object[1]->itsClassC = itsC2
both instances of object get links to itsC2.
Can rhapsody automatically sets the links?

Answer

When using arrays of objects like this ,Rhapsody is unable to determine how to initialise the individual associations.  So all the associations for the objects in the array get initialised the same. I.e. it assigns the first link to the association and then assigns to the second link to the same association. This is why they both associations show as being initialised to the second link.

You would either need to manually initialise these associations in the user code or explicitly model each instance using discrete objects.

Explicitly modelling large numbers of objects and their associations in Rhapsody diagrams is not really practical. If you have a large number of objects like this, their associations should be initialised in the user code.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Component":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

ibm11119177