Topic
3 replies Latest Post - ‏2013-10-24T10:34:48Z by mk_tses
mk_tses
mk_tses
4 Posts
ACCEPTED ANSWER

Pinned topic ReporterPLUS Relation $relVisibility, C++ Type

‏2013-10-21T13:00:44Z |

Hello,

I've got some questions regarding reporter plus regading Associations.

1. What is $relVisibility supposed to do/show? When I have a Relation in a Rhapsody C++ Model which is private/protected it is still displayed as "public". I've found no word in the documentation about relVisibility. Am I missing something? How do I output CPP_CG::Relation::DataMemberVisibility?

2. Is it possible to get the C++Type of a Relation? I can get the name of a class a relation is pointing to. But this might be overriden via OMContainer, etc. What I really want is the actual CType. How can i get that one?

Only printing the association name like in the rhapsody samples is rather useless.

 

Kind Regards

  • AE91_SHINJI_KANAI
    AE91_SHINJI_KANAI
    146 Posts
    ACCEPTED ANSWER

    Re: ReporterPLUS Relation $relVisibility, C++ Type

    ‏2013-10-24T07:59:03Z  in response to mk_tses

    Hi mk_tses,

    Regarding Q1, I could see the same problem. My guess was that this problem was introduced due to the depreciated CPP_CG::Relation::Visibility property as you can see here. So I did a experiment to verify my guess. I first defined the depreciated property in a factory property, create two classes with an association in between, change the property for the relation to non-Public... The result is, $relVisibility persistently returns "Public". Only workaround I can think of is to directly retrieve the value from CPP_CG::Relation::DataMemberVisibility. 

    1. Drag All Metaclasses > Class > itsRelations from model view to template view. 
    2. Highlight the item, and go to the Iteration tab.
    3. Select Association in Iteration type category, and set to [itsRelations]->[Property].
    4. Navigate to Condition tab.
    5. Set as below:
        Attribute: $propertyName
        Operation: =
        Value: "DataMemberVisibility"
    6. Drill down to its iteration item for
     [itsRelations]->[Property].
    7. Add $value to Heading. 

    This way, you should be able to display the value of 
    DataMemberVisibility for relations of your interest. 

    Best Regards,

    --Shinji


     

  • AE91_SHINJI_KANAI
    AE91_SHINJI_KANAI
    146 Posts
    ACCEPTED ANSWER

    Re: ReporterPLUS Relation $relVisibility, C++ Type

    ‏2013-10-24T08:23:45Z  in response to mk_tses

    Hi mk_tses,

    For your second question, if there is no pre-defined attribute available that serves your purpose or no way to call Rhapsody Java API directly or indirectly within from ReporterPlus template, only way I can think of is to compute the type manually based on values in Multiplicity/Qualifier/CG::Relation::Ordered for a particular relationship, which would be similar to an idea you already have by looking into OMContainer properties. Sorry I can't help you on this.

    Best Regards,

    --Shinji

  • mk_tses
    mk_tses
    4 Posts
    ACCEPTED ANSWER

    Re: ReporterPLUS Relation $relVisibility, C++ Type

    ‏2013-10-24T10:34:48Z  in response to mk_tses

    Hi,

    thank you a lot for the information.

    It has enabled me to create a Q expression to retrieve the visibility. As for the C++ Type: We'll probably settle for just displaying the name of the class we are "pointing" to in our in our documentation.

     

    Best Regards