Prerequisites:


To color Associations between a Block and a Use Case


  1. Create a Legend and a Legend Item.
  2. Right-click the Legend Item and open its Specification window.
  3. Click three dots  next to the Adornment property to specify it. Click OK.
  4. Click three dots  next to the Elements by Condition property to edit it. Elements by Condition dialog opens.
  5. In the Elements by Condition dialog, set the Element Type to Association.
  6. Select Create Operation > Operation from Model > IfThenElse.

    If you cannot see the IfThenElse operation, make sure the Apply Filter box is not checked.

  7. Select IfThenElse > Condition > Reset.
  8. Select Condition > Type Test
  9. Set the Operation Name to ‘1st End is Actor’ and Type to Block.
     
  10. Select Condition > Context > Reset.
  11. Select Condition > Context > Operation from Model > First End of Association.
  12. Select Condition > Context > Association > Reset.

  13. Select Association >  Contextual Variable.
  14. Select IfThenElse > Then > Type Test
  15. Set the Operation Name to ‘2nd end is Use Case’ and Type to UseCase.
  16. Select Then > Context > Reset.
  17. Select Then > Context > Operation from ModelSecond End of Association.
  18. Select Then > Context > Association >  Reset.

  19. Select Association >  Contextual Variable.
  20. Select IfThenElse > Else > Operation from Model > IfThenElse.
  21. Select Else > Condition > Reset.
  22. Select Condition > Type Test
  23. Set the Operation Name to ‘1st End is Use Case’ and Type to UseCase.
  24. Select Condition > Context > Reset.
  25. Select Condition > Context > Operation from ModelFirst End of Association.

  26. Select Condition > Context > Association > Reset.

  27. Select Association > Contextual Variable.

  28. Select Else > Then > Type Test
  29. Set the Operation Name to ‘2nd End is Actor’ and Type to Block.
  30. Select Then > Context > Reset.
  31. Select Then > Context > Operation from ModelSecond End of Association.
  32. Select Then > Context > Association > Reset.

  33. Select Association >  Contextual Variable.

  34. Select Then > Else > Boolean > false.
  35. Click OK.

Sample model

The model used in these examples is the Case Studies for Querying the Model sample model. To open this model, you need to download case studies for querying the model.mdzip