Cradle from 3SL, the complete Model Based Systems Engineering Toolsuite, specialising in requirements management, requirements capture, model based systems engineering and for systems engineering software, support and consultancy, the logical choice: Cradle from 3SL.
login Register forgot password or username?
Search:         

January 2012 [Cradle 6.5.1]

How to Link Cradle to Visio Symbols

Visio® is a popular drawing tool from Microsoft. It has a very wide range of diagram styles, ranging from simple block diagrams to notations from a range of engineering and other disciplines. For example, Visio supports data flow diagrams, BPMN and UML diagrams from software engineering.

Cradle provides two methods for linking to Visio diagrams:

  • Linking to an entire Visio drawing
  • Linking to individual symbols or groups in a sheet inside a Visio drawing

Both of these methods use the Cradle frame type mechanism to create data types that provide the link from an attribute in Cradle item(s) to Visio.

When linking to a Visio drawing, the frame type makes a link to the entire Visio file that is either stored inside the Cradle item’s attribute, or the attribute references the Visio drawing as an external file or at a URL or as an object in an external environment. When linking to a symbol or group of symbols in a sheet in a Visio drawing, the frame type makes a link from the Cradle item’s attribute to the symbol or group and the Visio file is referenced externally in a file, at a URL or in an external environment.

Cradle supplies the means to link Cradle items to symbols in Visio drawings. The following sections will show how to use this mechanism to create a link from a requirement in the as-supplied demonstration project DEMO to a symbol in an external Visio file, and how to start with a Visio diagram containing a set of symbols and create a set of items in Cradle, where each item will be linked to a different symbol in the Visio drawing.

The VISIO LINK Frame Type

Cradle provides the VISIO LINK frame type that can link to a symbol or symbol group in a Visio file. To see this frame type, login to your Cradle project as a user who has the privilege PROJECT so you can modify the project schema. Select Admin → Project Setup to start the Project Setup tool, ensure that Item Definitions is selected in the Options pull-down list and select the Frame Types tab:

Frame types are the attribute types (data types) in Cradle. The VISIO LINK frame type is part of the default schema used in the demonstration project DEMO supplied with all Cradle systems. If your project does not have the VISIO LINK frame type, select Update… to update your project’s frame types from the default schema. Selecting this button produces the Update Frame Types dialog:

Use this dialog to update your frame types, optionally overwriting any in the list that may already be in your project schema.

Select VISIO LINK and select Edit… to see the details of the frame type in the Frame Type Details dialog:

You can ignore most of the contents of this dialog. For now, the only important aspects are the Storage: field and the External Data Reference Labels.

The Storage: field has the value As File. This means that frames (attributes) of the VISIO LINK frame type are intended to link to Visio drawings held as files outside the Cradle database.

The External Data Reference Labels show that as well as the pathname of the Visio file, frames of type VISIO LINK will also store a Page Number in the Visio file and the Unique ID of the symbol or group to which the Cradle item’s attribute is being linked. This means that an attribute (a frame) in a Cradle item will link to a specific symbol or group of symbols in a specific page of the Visio drawing in a specified file.

Select OK or Cancel, as appropriate, when you are done.

Create Attribute of Type VISIO LINK

The previous step has ensured that the VISIO LINK frame type is available. Now you need to create an attribute of this type in a Cradle item type. You can, of course, create multiple attributes in multiple item types.

Select the Item Types tab in the Item Definitions group, select the item type to be modified (such as the pre-defined item type Requirement) and select Frames… to display the Frame Setup dialog:

Select New… to create a new attribute (called a frame in Cradle), enter a name for the attribute such as VISIO SYMBOL and select OK. The new frame is shown in the list and is automatically selected:

Without an explicit frame type, the new VISIO SYMBOL attribute will be a text frame that can store plain text. Select the Type: drop-down list and choose the frame type VISIO LINK:

Select OK to close the dialog and then select OK to save your modified schema.

Unique IDs in Visio

Every symbol and group in a Visio drawing has a Unique ID that identifies the symbol or group. To create links to symbols and groups in Visio drawings from Cradle, you need to find the Unique ID of the symbol or group that you want to link to. If you want to create items in Cradle from the Visio drawing, 3SL supplies a plug-in for Visio that does the job for you. This feature of the Cradle plug-in for Visio is explained later.

So, to create a link from Cradle to a symbol or group in a Visio drawing, you need to know the Unique ID of the symbol or group. Unfortunately, it is not easy to get the Unique ID from Visio itself. For example, it is not shown in the Visio Properties dialog for a symbol or group:

The Unique ID is also not shown in the (very extensive) ShapeSheet for the symbol or group:

3SL supplies a Cradle plug-in for Visio that is installed as part of the Cradle Toolsuite for Microsoft Office. It appears in Visio as a small toolbar:

To collect a Unique ID for a symbol or group, select the symbol or group and select the icon:

The symbol or group’s Unique ID will be shown in the Unique ID Capture Utility dialog:

You can copy the Unique ID by selecting it in the Unique ID: field and pressing CTRL-C or by selecting Copy.

You will need this Unique ID to create a link to the symbol or group from Cradle, as explained later.

Link to a Visio Symbol

The earlier step created a VISIO SYMBOL attribute in the Requirement item type. This means that items of the pre-defined Requirement item type can now have VISIO SYMBOL attributes that contain a link to a symbol or group in a Visio drawing.

To make such a link, open a Requirement, either in a view or in a form. In this example, a Requirement has been opened in a form:

The problem here is that the new VISIO SYMBOL frame is not shown, so you cannot link the Requirement to a Visio drawing. This is because this form was created before the VISIO SYMBOL attribute was added, so you will need to update the form definition to show the VISIO SYMBOL frame.

However, Cradle provides an Automatic scope form that is automatically updated whenever attributes are added to, or deleted from, the schema. Select the Requirement – Full form from the Form: drop-down list at the top of the WorkBench UI. As it is an Automatic scope definition, it is coloured purple and appears between the Project scope definitions (coloured blue) and the System scope definitions (coloured black):

When you select the Automatic scope Requirement – Full form, the VISIO DRAWING attribute becomes visible:

The VISIO SYMBOL frame is shown as a label and a button:

The frame is empty. Select it to show the pop-up menu and select Edit Reference… so that you can specify a file whose content will be loaded into the frame:

In the resulting External Reference Data dialog, specify the pathname, page number and the Unique ID captured from the Cradle plug-in for Visio described in the previous section, and select OK:

You can see that the names for the Page Number: and Unique ID: fields in this dialog are taken from the VISIO LINK frame type defined in the schema. So you can control the names of these fields in the UI.

The link details are shown in the form:

This has created a link between the symbol or group in the Visio drawing and the Requirement.

In this case, the Visio drawing is still a file outside Cradle. It can be viewed and changed independently of Cradle. So the VISIO SYMBOL attribute in the Requirement simply points to the symbol or group in the file.

If you want the link to be between the entire Visio drawing and a Cradle item (the Requirement in this case) or if you want the Visio drawing to be stored inside the Cradle database, then the attributes of the Cradle items should use the VISIO frame type, and not the VISIO LINK frame type.

Using the Visio Link

Once you have linked to a symbol or group in the VISIO SYMBOL frame, you can access it from any Cradle view or form that displays the frame.

When you select the button, the pop-up menu presents options to View and Edit the frame:

If you select either option, Visio will be opened on the file contained in the link, showing the page specified in the link and with the symbol or group specified in the link both selected and visible:

All of these details held in the link can be seen by selecting Properties… in the pop-up menu:

This dialog shows the details that Cradle stores for the frame, including the link to the Visio symbol or group, and also the information that Cradle records for all frames that link to external files. In particular, note that Cradle also records the size of the external file, and its last accessed and modified times.

If the Visio drawing is modified since Cradle last accessed it, then when you access the drawing from Cradle you may see a message of the form:

This message indicates that the external file has been accessed or changed since Cradle last accessed it, which may or may not be a problem. If it is a problem, then this problem is independent of Cradle. When you select OK, Cradle simply updates its record of the file’s size and times, and continues to open the Visio link.

Create Cradle Items and Links from Visio

The previous sections have shown how to create a link to a symbol or group in a specific page of a Visio drawing from Cradle. If you want to create the link in the reverse direction, from Visio to Cradle, then you use the Cradle plug-in for Visio that was mentioned previously.

The basis of this plug-in is to create or update one or more items in a Cradle database, and within each such item to create a link from that item to a specific symbol or group of symbols in a Visio drawing. So each item in Cradle will contain a link a different symbol or group. You can control which symbols or groups are to be linked to, which therefore controls how many items will be created or updated in the Cradle database.

This plug-in is shown as the small toolbar inside Visio:

To start the plug-in, select the icon:

and login to the Cradle project in which items are to be created or updated that will link to the drawing:

Select Options… in the resulting Cradle Capture – Symbol Capture Utility dialog:

The plug-in will automatically initialise with the item type(s) that are correctly configured to contain links to symbols in Visio drawings. Specifically, the plug-in searches your project schema for item types that contain frames of type VISIO LINK:

In this example, the plug-in has pre-selected the item type SBS. Any other suitable item types will be available from the Item Type: drop-down list. For the selected item type, the dialog finds the frame(s) that can contain the Visio links, lists them in the Frame: drop-down list and chooses the first of them, the frame DRAWING in this example.

If the Cradle item type has auto-numbering enabled, the Auto Numbering Options fields are disabled and show the numbering specified in the Cradle schema. Otherwise, you must specify the auto-numbering details so that the plug-in knows how to create the identities of the items that it will create or update inside Cradle.

Select OK or Cancel, as appropriate, when you are finished.

To create the items in Cradle that link to the drawing’s symbols or groups, select Acquire in the dialog and the plug-in lists all of the symbols and groups that it can find in the Visio drawing so that you can choose the symbols and groups that are to be linked to from Cradle. For example, given the drawing:

the plug-in will display:

You can select any or all of the symbols and groups shown. Selecting a page will select all symbols and groups in that page:

Select Capture when your selection is complete and one item will be created or updated in the Cradle database, as appropriate, for each selected symbol and group. When complete, the symbols and groups are coloured grey to show that they cannot be selected again as they already have a link to them:

You can select Close to close the dialog and re-open it at any time. You will stay connected to Cradle, so you do not need to login again. When you have finished capturing links to Visio in Cradle, you can either select the:

button to explicitly disconnect from Cradle, or simply close Visio which will automatically disconnect from Cradle.

After capturing the links in Cradle, one or more items will have been created or updated in the Cradle database. In this example, 7 items of type SBS have been created:

Each of the SBS items is named from the Visio symbol or group. Opening any of these SBS items in a view or a form will show the link to the Visio drawing symbol, in this case next to the label Drawing: in the form:

Selecting this symbol and Edit or View in the resulting pop-up menu will open the Visio drawing, change to the correct page, select the linked symbol and ensure that it is visible:

So the plug-in can create a collection of links from items in a Cradle database to individual symbols or groups in a Visio drawing. You can also create these links manually from Cradle. In both cases, the links can be followed from Cradle views and forms in the same way as any other attribute (frame) that links to an external file.