Wednesday, 28 October 2020

IBM Engineering Rhapsody Tip #87 - Custom browsers: A requirements Traceability example (Advanced)

This IBM Rational/Engineering Rhapsody tips and tricks videos follows on from the previous video (#86) on the SysML Profile's part browser. This video covers how it's possible to create your own "browse hierarchy' submenu's to launch browsers based on different context patterns. In this example I create a new browser for viewing traceability to requirements that mimics the Rhapsody Gateway's impact analysis view but doesn't require use of the Add On. I show use of the context pattern, including navigating reverse direction of a dependency (thanks' to Andy Lapping's digging in this area) and then use of a plugin method as part of the context pattern (I need to keep it as geeky as possible ;-). By extending Rhapsody with my own profiles, I'm able to focus SysML to specific tasks, making it easier for users to get higher business value earlier in their adoption lifecycle.


This caption-only advanced-level tip follows on from video #86.

The SysML Profile's parts browser provides an example of how Rhapsody can build a custom browser using a context pattern.

Let's create a custom browser for showing requirements traceability instead!

This Executable MBSE project has lots of traceability to requirements.

Conventionally, I may have used an add-on such as the Rhapsody Gateway to view such traceability. This can take a while to load though. 

Let's add a new browser to do this in Rhapsody instead. To add a new browser we need to create new properties. The New property button is not visible by default (it requires a rhapsody.ini tweak).

Top tip: Never edit the .ini file with Rhapsody open and always create a backup! 

To add properties via the UI we need to add ShowPropertiesButtonFromPropertiesPage=TRUE to the rhapsody.ini file.

To know which properties to create, I'll use the SysML profile as a guide. 3 properties are needed for each metaclass for which a right-click menu is desired.


Firstly, I'll create a Model::Project::BrowseHierarchy property on the Project metaclass. 

We'll define the value to make BrowseTraceability the [key] for the menu.

Now, I'll add a property using the [key] called Model::Project::BrowseTraceabilityName.

This will define "Browse Traceability" as the name of the sub-menu to add.

I now need to specify the context pattern. I'll create a Model::Project::BrowseTraceabilityPattern property for this. 

A context pattern is a way to describe a path of elements in the model. It's a comma-separated list of tokens. E.g., Look for nested packages, when you find a package, look for requirements.

Let's see if it worked?

Here's the new Browse Traceability menu!


The browser contains all of the packages (not just packages with requirements). 

Let's tweak the pattern. * means zero or more, whereas + means 1 or more.

That's better. The browser is now only showing packages that own requirements.

Next up, I want to find elements that trace to the requirements. This line says look at references which are dependencies and then go to the element that owns the dependency.

We can now see the elements that trace to the requirements. However, the dependency relation is also shown.

As a final example of tweaking, I'm going to use a plugin method. A plugin is a way to extend Rhapsody with Java code. Plugins run in the Rhapsody process.

This Java method is in my RPUserPlugin class for my Executable MBSE profile.

I'll replace the references check with this plugin method instead.

The element list below the requirement is now being created by the plugin method.

Job done! This view is rather similar to the Gateway's Impact Analysis view but I don't need to leave Rhapsody ;-)

Interested in advanced training or customizations? Email me.

No comments:

Post a comment

Note: only a member of this blog may post a comment.