For those not yet in the know, SodiusWillert Power Pack for IBM Rhapsody is a comprehensive collection of helpers, custom model browsers, and table layouts developed to add more value to your IBM Rhapsody environment. Why such a tool, you may ask?
Well, although IBM Rhapsody is a fantastic modeling tool that enables you to push the boundaries of system and software creation even further, some tasks are still quite tedious and error-prone to perform. Power Pack has been developed by our experts as a means of streamlining some functions and procedures and eliminating laborious and manual routine workflows. In short, to let your daily work with IBM Rhapsody run more smoothly.
You're about to read the second episode of our series of articles dedicated to every single automation helper included in the Power Pack - from the problem it solves to how you can use it in your workflows, all accompanied by video tutorials.
In the first episode, we introduced and detailed the five first helpers (deleting events, creation, and edition of Context Pattern, an alternative to ‘Change To’, etc.). Today, a new batch of five more great helpers is ready and waiting for you!
So, enjoy your reading and happy automating!
TABLE OF CONTENTS
1. Create Model Elements from Copy Buffer
2. Locate messages and Lifelines
3. Diagram Information Boxes Creator
1. Create Model Elements from Copy Buffer
In certain situations, you may need to create model elements in bulk from existing text. This Power Pack helper enables this very operation as it automates the process of creating model elements by allowing the user to copy plain text from any application or text source.
And there's more! You don't have to worry anymore about using compliant characters with IBM Rhapsody naming rules. Our helper takes care of removing all illegal characters.
How does it work?
- First thing first, right-click on the selected text (for example, from inside a Microsoft Word document) and copy it.
- Then, there are two possible scenarios:
- You use ‘Table Layout’. In this case, the new elements will be created in the same package as this layout. Right-click the Use Case layout → Select Power Pack → Create Model Elements from Copy Buffer. (Fig. 1)
- Another possibility, you use the 'Table View'. Same procedure and the new elements will go into the scope of this view.
Fig. 1 Creation of a Model Elements from Copy Buffer here using the Table Layout
ℹ️ In all cases, the 'Layout' criteria of the Tabel Layout determines what type of model element to create
If you follow the same procedure as explained above (‘Table Layout’) for the 'Block Layout', you'll see that the block names will be different from the original text (Fig. 2). Illegal characters such as spaces are removed or replaced according to certain properties that you can define at the project or package level.
Fig. 2 - For this Block Layout, illegal characters such as spaces were removed from the block names. They were automatically replaced by underscores.
How do you implement naming properties?
- Go to 'Project properties'. You'll see a ‘Power Pack’ perspective and then a 'Create from Copy Buffer’ tab. (Fig. 3)
Remember that Rhapsody has different rules on the allowed names for different types of model element. So, a name that works just fine as a use case may not work if you try to use it to name a package. For that reason, our helper will check if the model elements you want to create are non-executable by examining the criteria in the table layout against the list in this property (Fig. 3). That will then allow it to select one of these two other replacement properties (both of which contain a set of regular expression patterns).
Fig. 3 - Implementing naming properties from Project Properties based on different lists of illegal characters, and replacement characters
📺 Watch this tutorial about how to create Model Elements from Copy Buffer
2. Locate Messages and Lifelines
Navigating from a lifeline on a sequence diagram to the corresponding lifeline in the Rhapsody model browser is usually a simple procedure – as long as the element remains unrealized.
Let’s say we want to add a lifeline to the diagram and then use Rhapsody’s ‘Locate in Browser’ feature. It will highlight that lifeline in the model browser. Now, suppose we decide to ‘Auto-Realize’ a lifeline, and then again use ‘Locate in Browser’. Rhapsody will now highlight the realizing element in the browser.
However, what if in certain cases you still want to ‘Locate’ the lifeline? You won't be able to do it because Rhapsody provides no means of locating a ‘Realized’ lifeline’. And the same thing applies to messages. Our Power Pack, on the other hand, fills this gap with a navigation option that locates the lifeline or the message, whether realized or not.
How does it work?
- Right-click on the lifeline → Select ‘Power Pack’ in the drop-down list → ‘Locate Lifeline in Browser’ (Fig. 4)
- Proceed as above to locate messages.
Fig. 4 - Locate Lifeline in Browser
📺 Watch this tutorial about how to Locate messages and Lifelines
3. Diagram Information Boxes Creator
Adding information boxes to a diagram is a very convenient way of documenting that diagram. Well, we have excellent news for those who have waited a long time for this feature. Our Power Pack helper enables you to create Diagram Information Boxes (or update existing ones), either manually or automatically.
You also have the option of customizing the content you want to see in those boxes.
How does it work?
- Manual launching of new Diagram Information Boxes. You have two options:
- You can add it directly from a diagram: right-click the background of the diagram and select Power Pack → Diagram Tools → Add or Update Diagram Information Box.
- Or by right-clicking a Package or even the Project: the procedure remains the same as seen above (Fig. 5) but applies to all diagrams in that package/project, providing the appropriate properties are set:
Fig. 5 - Manual launching of new Diagram Information Boxes by right-clicking a Package
At this point, the menu won’t do anything yet and you’ll notice that the diagrams are still empty. The helper only adds new boxes if the owning package of the diagram has the appropriate property set. Here’s how to achieve this:
- You must first tick the properties for the diagram types. (Fig. 6)
- Then you manually invoke the helper again, using the same process as earlier.
- All the diagrams in that package (of the selected type) now have Diagram Information Boxes.
Fig. 6 - Property set allowed by the helper for the owning package of the diagram
- Automatic Launching of new Diagram Information Boxes. Again, you have two options:
- You can create a new diagram information box whenever you create a diagram of a specified type. To enable this, all you have to do is set a property on the project →Tick 'TriggerOnNewElements' (Fig.7) That will trigger the helper to run whenever you create a new diagram, provided the ‘AddTo’ property for that diagram type is also set.
- A second option is to set the 'Trigger On Project Save' property to true - (still at the project level) (Fig. 7).
ℹ️ This option will never create new boxes or add existing boxes to diagrams if they have been manually removed from view. It only updates existing boxes. The contents of existing boxes will be updated if the diagram has been modified, although the position will only change if you have previously selected the right property.
Fig. 7 – Setting properties on the project to automatically create a new diagram information box.
- Customization
By default, the diagram box has four tags that display content on the diagram. If you don’t want all of these tags or if you want to provide your own, our helper allows you to do so. A sample model included with the Power Pack shows how.
- First, create your own new term stereotype or stereotypes applicable to the comment. (The sample model illustrates this )
- Add whatever tags you want to that stereotype
- You can also reuse some of the out-of-the-box tags by simply copying them to your stereotype
To have the helper use your box instead of its own you just need to set a property called 'CustomDiagramInformationStereotype'. (Fig. 8)
If you provide your own tags, you'll need to write your Java code to update them. You can tell the helper to automatically invoke your Java code by specifying this property: ‘PostProcessPlugin’. (Fig. 8)
Fig. 8 - Another Property set allowing your new terms to be applied
📺 Watch this tutorial about how to create Diagram Information Boxes
4. Locate Applied Stereotypes
You probably know that locating and navigating to stereotypes that have been applied to model elements is a cumbersome manual task in IBM Rhapsody.
For example, in a model, you can have SysML Blocks that also have additional stereotypes, ( Block itself is a new term stereotype based on Class). However, Rhapsody doesn't provide any way of finding this stereotype and it doesn't appear at all in the ‘Features’ dialog box, except in the title bar. If you need to find it, you have no choice but to perform a manual search.
The same applies to stereotypes of non-new terms. If you want to find them, you still have to do a manual search. But thanks to this Power Pack helper which optimizes and simplifies the search procedure, you no longer need to manually look for stereotypes.
How does it work?
- If you are using IBM Rhapsody 9 or older versions: Right-click the element and select Power Pack → Locate Applied Stereotypes.
- If you are using IBM Rhapsody 10: You have additional options including a toolbar button, main menu, and keyboard shortcut. (Fig. 9)
Fig 9. - Locating Applied Stereotypes with IBM Rhapsody 10 directly from the toolbar
- If there's only one stereotype in the given block, the Power Pack helper will simply navigate to it.
- If there are several stereotypes, that's where things get interesting. A little box ‘Locate Stereotypes’ will open when you invoke the helper. All you have to do is navigate to the stereotype of your choice by clicking on a button. (Fig. 10)
Fig. 10 - ‘Locate Stereotype’ included with the helper allowing stereotype navigation
📺 Watch this tutorial about how to Locate Applied Stereotypes
5. Navigating Generalization
Locating the 'other end' of a generalization relationship in IBM Rhapsody usually involves a series of different steps and clicks on countless windows. And when you're working with more complex profiles such as AUTOSAR, UAF, and M2M, it's even worse. You often end up with a complex hierarchy of generalizations, where stereotypes are inherited from multiple other stereotypes.
Thankfully, SodiusWillert's Power Pack for IBM Rhapsody greatly simplifies the navigation of generalization relationships.
How does it work?
- If you are locating the stereotype from your browser:
- With IBM Rhapsody 9 and below: Right-Click the stereotype → Power Pack → Navigate to Base
- With IBM Rhapsody 10: Again, you can use the toolbar button, the menu, or the keyboard shortcut.
Please note that there is another, more powerful, way to proceed, especially when you have multiple generalizations:
- Instead of right-clicking the generalization, right-click its owner → Power Pack Browsers → Browse Stereotype Inheritance (Fig. 11)
- The Power Pack provides additional model browsers such as 'Browse Stereotype Inheritance'. (Fig.12)
This browser allows you to navigate the complete hierarchy of generalizations in a much more convenient way.
ℹ️ You can use your keyboard's number pad (pressing the star button) to fully expand any of Rhapsody's models.
Fig. 11 - ‘Browse Stereotype Inheritance’ function to navigate several generalizations
Fig. 12 - Browse Stereotype Inheritance, an additional model browser
📺 Watch this tutorial about how to navigate Generalization Relationships
And that's a wrap for today. Stay tuned for episode 3 for even wilder helpers! In the meantime, take a look at Episode 1.
➡️ Was this article helpful? Let us know and subscribe to our blog to be notified of the next release of this series!
➡️ Contact us if you have any questions and if you’d like to get started with Power Pack for IBM Rhapsody
➡️ Find out more about our training courses and workshops on IBM ELM.
Leave us your comment