Cameo Systems Modeler - Metachain Navigation

Cameo Systems Modeler - Metachain Navigation


When it's time to "query" your model in Cameo Systems Modeler (a.k.a. MagicDraw), you'll be sure to find yourself looking at the structured expression dialogue, asking some valid questions, such as, What am I supposed to do now, or, how do I know which properties to select? There's so many! This article will hopefully get you started in the right direction.

No alt text provided for this image

First of all, what is a metachain? A metachain is simply the term used in Cameo Systems Modeler to describe a query that has a starting element type, and produces results of other elements that are related to the base element type in a specific way. That specific way can be considered a data chain or "metachain" that links those elements together. After all, the whole purpose in creating a model is to show how certain elements, or parts of a system, are related to other elements. In the image above you see an example of elements that are linked by specific SysML relationships such as the <<satisfy>> and <<verify>> relationships. If we want to see all of the Test Cases that are linked to System 1, we can create a query by way of a metachain that shows Blocks that satisfy a requirement, that have a verify relationship with a Test Case at the other end. Putting the query in place can save a lot of time, since it's dynamic and continually updates its results based on what is true and current in the model. These results can then be pulled into documents to produce Specifications, Interface Control Documents, or Test Plans etc.

One thing you need to know is that your query must have a starting point, a direction, and the desired results, or "return." If you were to build a query starting with the Test Case as the base element (using the example above) and want to produce the results of the blocks at the other end, your metachain will be the opposite of one that starts with the Block and produces the Test Case.

So where do we begin? Well, first, we need to find the Structured Expression dialogue. To do that, open either a Generic Table, a Dependency Matrix, or a Relation Map. There's a few other ways to get to the structured expression dialogue as well but for now we'll focus on the Generic Table.

No alt text provided for this image

When the table opens, you'll need to choose the Element Type and the Scope. Keep in mind, when you select the element type, either by dragging in an element, or selecting, by using the ellipsis (...), the element or elements that you designate as the Element Type will be the starting point of your query, or the base. Any other query performed in this table will have to start at that same element type. If you'd like to start with a different Element Type, you'll need to make a different table or matrix, to perform queries that start with that element type.

The Scope is typically a Package that contains the base element(s) but the Scope can be any namespace, or element that contains other elements, such as a Block, or an Activity etc.

At the top of the table, you'll see the option for "Columns." This allows you to create a query that will show results in a specific column with a custom name.

No alt text provided for this image

Your next move is to decide whether to create your query as a "New Derived Property" or a "New Custom Column." The difference being, queries created as a New Custom Column will be local to the table or matrix, while New Derived Properties are available anywhere in your model, such a Specification dialogues for the base elements of the query, and can also be queried by Velocity Scripts using Velocity Template Language (VTL). Which one to choose is up to you, but keep in mind, if your query isn't tight enough, or you accidentally query elements in your model that you didn't intend to, the name of your query can cause a lot of confusion for other practitioners. With this in mind, if you're new to queries, your best bet will be to practice by using a New Custom Column and save the derived properties for when you get better at dialing in your query results.

When you select "New Custom Column" or "New Derived Property" you'll find yourself in the Structured Expression dialogue.

The Structured Expression dialogue is where you enter in your metachain. Before we do that, however, rather than searching through the exhaustive options that you'll have available in the metachain drop down menus, let's take a quick step back to talk about a good method for determining what the metachain will be for a given query.

Step 1: Open the Specification for the base element of the query. This will be the element, such as a Block, that is set as the element type in the table. After opening the Specification for the element, jot down the type of element that you're looking at. This will be at the top left side of the Specification window.

Step 2: Look for the relationship that connects the base element to the next element, such as the <<Satisfy>> relationship. Jot down the name to the left of the relationship such as "Client Dependency," which is the meta model's way of describing how this relationship is being used in this context. It's like saying "The Block has a Client Dependency, that is the Satisfy relationship."

No alt text provided for this image

Step 3: Open the Specification of the relationship that leads to your connected element.

No alt text provided for this image

Step 4: Jot down the type of element whose specification dialogue you are now looking at. In this case, it is the <<Satisfy>> element's specification.

Step 5: Jot down the name to the left of the element that is the next step in your metachain. In this case, the Requirement is the "Target" of the <<Satisfy>> relationship. Your notes will now look something like: "Block / Client Dependency, Satisfy / Target"

This is the metachain that will produce all of the elements connected to the base element in this way.

No alt text provided for this image

If we continue this pattern of discovering the next steps in the chain, then the metachain that leads to all of the Test Cases that Verify the Requirements that Satisfy the Block will look something like: "Block / Client Dependency, Satisfy / Target, Requirement / Supplier Dependency, Verify / Client."

To enter this into the Structured Expression dialogue, decide whether you'd like these query results to be local to the table by selecting "New Custom Column," or available in other parts of your model as a "New Derived Property."

When the dialogue opens, select Metachain Navigation on the left, then Insert on the right.

No alt text provided for this image

Enter the first row of the meta chain by using the dropdown menus to select first the "Metaclass," which in this case is the Block, then the "Property," which in this case is the Client Dependency. After each row is entered, select Insert to enter the next row. Don't forget to Name the column something other than "Unnamed1," which is the default.

No alt text provided for this image

After you've entered the metachain, select OK then view the results in the table or matrix.

No alt text provided for this image

The results will look similar to this and may include many more elements.

This is the general method used for discovering meta chains that produce the results of queries in your model.

There are a lot of nontypical cases, however, where this method simply does not work because you will never find the next step of the metachain in the specification dialogue. This is usually due to the way properties are assigned in the UML and SysML meta models. For cases where the desired direction of meta chain is "non-navigable" based on the meta model properties, Cameo uses "synthesized" properties that are not actually properties of the Blocks/Classes. When this is the case, you will come up empty in your search through the Specification dialogues for the properties leading toward the desired results. In these cases you will need to use "backwards navigation" which is what is implied by the properties in the Expression dialogue that begin with an underscore, such as "_directedRelationshipOfSource."

No alt text provided for this image

An example of when you would want to use backwards navigation is in a case of the image below where you may want to see the Block, or tier, above the lower tier to see which Blocks are using the "Power Subsystem" as a Part of their system.

No alt text provided for this image

Since the filled in diamond end of the Directed Composition relationship is theoretically non-navigable by way of meta model properties, you will need to use a synthesized property that Cameo has added to allow this direction of metachain navigation. The format used for this synthesized property is _targetType Of targetTypeProperty. Note the property begins with the underscore. Using this example, if we want to return the results of "System 1" starting with the Power Subsystem we will first need to navigate to the Association relationship Of the End Type. The "End Type" in this case happens to be the Power Subsystem block, which is where we are beginning. So the first step is simply navigating backwards, in a typically non-navigable direction), to the association relationship. The next step is to navigate to the owning end of that association, which in this case is the one connected to System 1. So we add in the "Association / Owned End." The last step is to get to the "Type" for the property, which happens to be the System 1 block. Therefore, the last step in this metachain is "Property / Type."

No alt text provided for this image

There are many more scenarios where backwards navigation comes into play and needs to be used to return the results you'd like for your query. I'd recommend practicing and learning more about how the UML and SysML meta models can be referenced to discover these valuable pathways through your system.

To conclude, metachain navigation is one of the most powerful tools at your disposal as an MBSE practitioner due to its ability to show how specific parts of your system are related to others in an otherwise obscure way.

Setareh Saremi, ASEP

Model-Based System Engineer I 2nd level specializing master in SpacE Exploration and Development Systems (SEEDS)

1 年

Thanks, it was very helpful. I wanted to ask where can I get the pdf version.

Ryan Boyce

Systems Engineer at United States Air Force

2 年

Thanks! This helped a lot. Do you know of anymore resources to learn about metachains, derived properties/custom columns and anything else in this vein?

Grant Caillouet

Principal Model-Based Systems Engineer at STC

3 年

Awesome article, thanks for sharing!

要查看或添加评论,请登录

Brian Moberley的更多文章

社区洞察

其他会员也浏览了