Sie sind auf Seite 1von 77

18.

1
tutorial

No Magic, Inc.
2015
All material contained herein is considered proprietary information owned by No Magic, Inc. and is not to be
shared, copied, or reproduced by any means. All information copyright 2008-2015 by No Magic, Inc. All Rights
Reserved.
CONTENTS

1 . GETTING STARTED WITH CAMEO DATAHUB 3


1.1 Cameo DataHub Introduction 3
1.2 Installation 3
1.2.1 Installing Cameo DataHub using Resource/Plugin Manager 3
1.2.2 Installing Cameo DataHub from the plugin source zip file 4
1.2.3 Deploying the plugin for IBM® Rational® DOORS® 5
1.2.4 Upgrading from previous versions of DataHub 6
1.2.5 Migrating DataHub data from previous versions of DataHub 7
1.3 DataHub Basic Operations 9
1.3.1 Opening the DataHub Explorer window 9
1.3.2 Adding a CSV Data Source 10
1.3.3 Adding an IBM® Rational® DOORS® Data Source 12
1.3.4 Adding an IBM® Rational® DOORS® Next Generation Data Source 13
1.3.5 Showing and Hiding MagicDraw® Data Sources 15
1.4 Basic Features of DataHub 17
1.4.1 Copying data into MagicDraw® (and out of MagicDraw®) 17
1.4.2 DataHub Operations drop-down 21
1.4.2.1 Copy Data 22
1.4.2.2 Copy Data with Sync 23
1.4.2.3 Create OSLC Link 24
1.4.3 Create OSLC Query 26
1.4.4 Copying OSLC Query Results 29
1.4.4.1 Copy OSLC Query Results to MagicDraw® as SysML Requirements 29

2 . WORKING WITH DATAHUB 32


2.1 How Synchronization Works 32
2.1.1 Tracking DataHub Data Changes 32
2.1.2 Synchronization Options 34
2.1.3 Sample Synchronization Scenario 36
2.1.4 Recursive Synchronization 38
2.2 More synchronization and Schema Mapping options 40
2.2.1 One-way Synchronization 40
2.2.2 Checking for Node Changes Before Synchronizing Data 42
2.2.3 Excluding Some Nodes in Copy Data 43
2.2.4 Synchronizing Changes in Data Hierarchy 46

1 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


CONTENTS

2.2.5 Synchronizing Changes in Schema Mapping 48


2.2.6 Group Type Mapping 49
2.2.7 Defining the Target Type from an Attribute's Value 50

3 . MORE DATAHUB FEATURES 57


3.1 Creating an Alias 57
3.1.1 Working with the Alias Manager 58
3.2 Working with DHLink Panel 59
3.3 Working with Clean Up DataHub Database menu 61
3.4 Working with Schema Map Manager 63
3.5 UI Components of the Schema Map Manager 64

4 . USEFUL SCENARIOS 67
4.1 Working with CSV Data Source 67
4.1.1 Retrieving New Data from CSV File 67
4.1.2 Saving New Data into CSV Data Source 69
4.2 Working with DHLink Summary Report 70
4.2.1 Working with the Report Template 72
4.2.2 Copying Data with Custom Types and Properties 74

2 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


1 . G E TTIN G STA RTE D WITH
C AM EO DATAHUB
1.1 Cameo DataHub Introduction
The primary use of Cameo DataHub is copying data with synchronization capabilities, to and from the following
requirement management tools.
®
• MagicDraw 18.0 or later
® ® ®
• IBM Rational DOORS 8.1, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5 client
® ® ®
• IBM Rational DOORS Next Generation
• CSV File repository

You can copy text-based requirements and requirement objects between the above mentioned applications.

1.2 Installation
The recommended way to install the Cameo DataHub plugin is via the MagicDraw® Resource/Plugin Manager.

1.2.1 Installing Cameo DataHub using Resource/Plugin Manager

To install Cameo DataHub plugin using the Resource/Plugin Manager

1. From MagicDraw® main menu, click Help > Resource/Plugin Manager. The Resource/Plugin
Manager dialog will open, Figure 1.
2. Select the Cameo DataHub check box under the Plugins(Commercial) option.
3. Click the Download/Install button.
4. Restart MagicDraw® once download/install process completes.

3 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Installation

Figure 1 -- Installing DataHub via the Resource/Plugin Manager

1.2.2 Installing Cameo DataHub from the plugin source zip file
Cameo DataHub can also be installed from the source zip file of the plug-in if you have downloaded it to your local
file system.

To install the DataHub from a zip file do the following:

1. From the MagicDraw® main menu, click Help > Resource/Plugin Manager. The Resource/Plu-
gin Manager dialog will open, Figure 1.
2. Click the Import button to browse the local file system to locate the file.
3. Click the Close button of Resource/Plugin Manager dialog to close it.
4. Restart MagicDraw®. The installation will complete after MagicDraw® starts up again.

4 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Installation

NOTE After the installation of DataHub, the DataHub menu items will not be
enabled by default. They become enabled only when a new or existing
project is opened in MagicDraw®. The Create OSLC query menu item
is enabled only after you add an IBM® Rational® DOORS® Next Gen-
eration data source.

1.2.3 Deploying the plugin for IBM ® Rational ® DOORS ®


Prior to adding a DOORS data source, the DOORS driver must be deployed.

To deploy the DOORS driver

1. From the MagicDraw® main menu, click Tools > DataHub > Driver Deployment, Figure 2.
2. The driver deployment dialog appears as in Figure 3. Choose a version of IBM® Rational®
DOORS® for which you would like to add the driver from the version drop-down, Figure 3. Click the
Add button and a browse dialog will appear, Figure 4, which prompts you to choose your DOORS
installation directory. Locate it and then click Open.
3. The DOORS driver will be deployed and you can now add a DOORS data source.

5 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Installation

Figure 2 -- DataHub Driver Deployment for DOORS

Figure 3 -- DataHub Driver Deployment for DOORS dialog

6 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Installation

Figure 4 -- DataHub Driver Deployment for DOORS - Choose installation directory

NOTE It is important to choose the DOORS version before you click the Add
button.

1.2.4 Upgrading from previous versions of DataHub


Upgrading DataHub version involves removing the older version first. After the current DataHub has been
removed, you can use one of the two installation methods detailed in (1.5) Installation to re-install DataHub.

To upgrade DataHub version

1. Click Help > Resource/Plugin Manager.


2. Select Cameo DataHub from Plugins(commercial) and click the Remove button.
3. After you have removed the Cameo DataHub plugin, you can re-install it using one of the two
installation methods mentioned in (1.5) Installation.

1.3 Migrating DataHub data from previous versions of DataHub


Starting from DataHub version 17.0.2 or later, DataHub data can be migrated using the Migrate DataHub menu
item.

The current release of DataHub does not support data migration for Requisite Pro, Cameo Requirements+, and
MagicRQ plugin data sources. The current release only supports data migration from DOORS and CSV data
sources to MagicDraw® and vice versa, or from MagicDraw® to DOORS and CSV data sources. Either the source
or target must be a MagicDraw® data source.

To migrate DataHub data do the following

1. Open a MagicDraw® project. This can be a local or TeamWork project.

7 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Installation

2. Start DataHub explorer. Then, add all the data sources you would like to migrate and connect
them.
3. Click Tools > DataHub > Migrate DataHub from MagicDraw® main menu. The migration dialog,
Figure 5, will appear.
4. Choose either the first or second option. If you chose the first option, select the DataHub version
to migrate from the list. If you chose the second option, click the Browse button to locate the Data-
Hub directory. In Windows, this is C:\Users\userdirectory\.datahub, and under Linux, it is /home/
userdirectory/.datahub
5. Click the Migrate button on the migration dialog.
6. The DHLink from the older version of DataHub will be migrated to the current DataHub version.

Figure 5 -- Migrate DataHub Dialog

NOTE • Scope sync relations from previous DataHub versions will be


migrated to Synchronized DHLink.
• Sync Auto and Sync Manual relations will remain the same.
• Trace relations will be migrated to OSLC links of type elaboration. If
the migration is performed from MagicDraw® to DOORS or CSV data
sources, then an elaborates OSLC link type will be created. If the
migration is performed from CSV or DOORS data sources to
MagicDraw®, then an elaboratedBy OSLC back link will be created.

8 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

1.3 DataHub Basic Operations


After installing Cameo DataHub and deploying the driver for DOORS, you can begin to add various data sources.
Data Sources can be added for
• IBM DOORS
• IBM DOORS Next Generation
• CSV Files

Once you have the data sources in DataHub open, you can then begin to explore the more advanced features of
DataHub, like copying data and DHLink relations between data sources. The synchronization features of DataHub
will also be illustrated.

1.3.1 Opening the DataHub Explorer window

To open the DataHub Explorer

1. Create a new MagicDraw® project or open an existing one.


2. Click Tools > DataHub, then select the DataHub Explorer option from the menu.
3. The DataHub Explorer tab will open Figure 6.

Figure 6 -- DataHub Explorer

9 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

NOTE • Nodes under a particular driver in DataHub Explorer represent nodes


in the application that the driver represents.
• If a driver is correctly started, the name will appear in the treeview in
DataHub Explorer. The driver will connect to data in each respective
application.

1.3.2 Adding a CSV Data Source

To add a new CSV data source to the CSV driver.

1. Click the Add Data Source button on the DataHub explorer toolbar. The Add Data Source dialog
will open, Figure 7.
2. Select CSV from the driver drop-down.
3. Enter the CSV information in the following fields:

Figure 7 -- Adding a CSV Data Source

• File: the CSV file to be added.


• Key: the name of the column header that will be used as the ID of the node. If you leave it blank,
the data source will not have any synchronization capability.
• Label: the name of the column header that will be created as the name of the node. This field is
not mandatory and you can leave this blank.
• Separator: select a delimiter for the CSV file. The available delimiters are comma, semi-colon,
space, and slash.

10 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

• Save Option: if you select the Save automatically whenever changes are made check box,
DataHub will make changes to the CSV file once the CSV Data Source is changed.
4. Click the Create button. Figure 8, shows the results of adding the CSV data source.

Figure 8 -- Result of adding a CSV Data Source

NOTE A CSV file must contain names of attributes in the first row and data in
the following rows.

Once the CSV Data Source has been created:


• The order of data in the treeview in DataHub Explorer
is the same as that of data in the CSV file.
• If you edit data in the treeview in DataHub Explorer,
you need to click Save to save the new data to the CSV
file, unless you have selected the Save automatically
whenever changes are made check box.
• If data in the CSV file has been updated, you need to
click Reload to update the treeview in DataHub
Explorer.
• For unmapped columns, users can add/edit/remove
the column and continue working.

11 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

1.3.3 Adding an IBM ® Rational ® DOORS ® Data Source

To add an IBM® Rational® DOORS® 8.x or 9.x data source

1. Click the Add Data Source button on the DataHub Explorer tab. The Add Data Source dialog will
open, Figure 9.
2. Choose IBM® Rational® DOORS® driver from the driver drop-down, Figure 9.
3. Click the Create button and your DOORS data source should now appear in the DataHub
explorer tab, Figure 10.

Figure 9 -- Adding a DOORS 9.x data source

12 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

Figure 10 -- Result of adding a DOORS data source

NOTE Before you can add an IBM® Rational® DOORS® data source, you
need to start the DOORS client on your machine and then log on to
DOORS, otherwise MagicDraw® will generate an error dialog.

1.3.4 Adding an IBM® Rational® DOORS® Next Generation Data


Source

To add an IBM® Rational® DOORS® Next Generation data source

1. Click the Add Data Source button on the DataHub explorer toolbar. The Add Data Source dialog
will open, Figure 11.
2. Select IBM® Rational® DOORS® Next Generation from the driver drop-down and you will be pre-
sented with Figure 11, where you will need to fill in the Service Provider URL, Authentication
URL, and the username and password for the DOORS Next Generation database server. The
service provider URL is of the form https://host:port/rm/rootservices. The Authentication URL will
populate by itself and is of the form https://host:port/jts/j_security_check. An example might be
https://dng.th.nomagic.com:9443/rm/rootservices/
3. Click the Test Connection button to ensure that the connection succeeds. Then click the Create
button and a DOORS Next Generation data source will appear in the DataHub explorer tab.
4. Figure 12, shows the newly created data source.

13 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

Figure 11 -- Adding an IBM® Rational® DOORS® Next Generation data source

14 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

Figure 12 -- Result of adding an IBM® Rational® DOORS® Next Generation data source

1.3.5 Showing and Hiding MagicDraw ® Data Sources

By default, MagicDraw® data sources are not shown in the DataHub explorer tab. DataHub can work directly with
the MagicDraw® containment tree. If, however, you wish to see MagicDraw® data sources in the DataHub explorer
tree, then follow the steps below.

To add a MagicDraw® data source to DataHub explorer tree:

1. Click Options > Environment > Cameo DataHub.


2. In the General group of options, de-select the Filter MagicDraw data source in DataHub
Explorer check box, Figure 13.
3. A MagicDraw® data source should now appear in the DataHub explorer tab, Figure 14.

15 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
DataHub Basic Operations

Figure 13 -- Enabling MagicDraw® data source from DataHub options

16 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 14 -- Result of enabling MagicDraw® data source

1.4 Basic Features of DataHub


The preceding sections illustrated how to use the DataHub to add various data sources. This section will introduce
more features of Cameo DataHub.
• Copying requirement objects and other data
• Schema mapping while copying data
• Copying Data with Sync

1.4.1 Copying data into MagicDraw ® (and out of MagicDraw ® )

Data can be copied into the MagicDraw® containment area from other data sources. Data can also be moved from
MagicDraw® into other data sources like DOORS and CSV repositories. While moving the data, the DataHub
Copy Data dialog will prompt you to map the source and target types as well as their attribute types. After the
source and target types have been mapped, the data can be copied.

To copy data into MagicDraw® (or to copy it to other data sources)

1. Drag and drop the data node from another data source like DOORS, Figure 15.
2. The Copy Data dialog opens and you need to map the source and target types, Figure 16.
3. There are a few points to note while mapping the source and target nodes.
• Mapping mode - this can be either Individual Type mapping or Group Type
mapping. Individual type mapping lets you map the individual nodes themselves while
Group type mapping, Figure 17, lets you map the node type as a whole.

17 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

• Set as Default Target Type - If you select this check box, the source nodes are
mapped to the selected stereotype element type, as a default. The Copy Data dialog will
not open the next time you copy the same type of data.
• Define target Type from Attribute value - This mapping option is only available for
group mapping mode. In this mapping mode - node values and their target types may
specified, Figure 18.
•. Exclude all unmapped nodes from DHLink - unmapped nodes are marked with a red
circle beside them and mapped ones have a green circle. If this check box is selected,
unmapped nodes will not be copied and the source nodes will be marked as excluded
with an ‘X’ symbol.
• Sync Direction - Two-way sync, Source to target and Target to source. Two-way
sync will change the nodes on both ends, while a Source to Target or Target to Source
sync will only change a single side.
4. Choose a mapping type, either group or individual, then map the source types to target types, and
map source attributes to target attributes. When the nodes have all been mapped, the red circles
beside them will change to green. Optionally, you can select the Exclude all unmapped nodes
from DHLink check box to exclude nodes which have not been mapped from being copied.
5. After the mapping is completed, a confirmation dialog appears, asking you to confirm the copy.
After confirmation the nodes are copied to MagicDraw® containment area.

Figure 15 -- Copying data from DOORS data source to MagicDraw®

18 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 16 -- Copy Data Dialog with Individual Type mapping

19 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 17 -- Copy Data Dialog with Group type mapping

20 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 18 -- Define Target Type from Attribute Value

1.4.2 DataHub Operations drop-down


The DataHub supports copying data in three different operation types, Figure 19.
• Copy Data
• Copy Data with Sync

21 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

• Create OSLC Link

1.4.2.1 Copy Data

This DataHub operation type supports copying data between CSV repository, MagicDraw®, IBM® Rational®
DOORS®, and IBM® Rational® DOORS® Next Generation data sources. This operation does not allow for
synchronization, so data changes will not be tracked. Copying data is achieved simply by dragging and dropping
the node from source to target.

Figure 19 -- DataHub Operations drop-down

To copy data do the following:

1. First select the operation mode from the DataHub explorer operation drop-down as in Figure 19.
2. Drag any node from DataHub explorer to MagicDraw® containment area, Figure 21. If the node
contains sub-nodes, a confirmation dialog, Figure 20, asking you whether you want to recursively
copy them will appear. Click the Yes button to copy all child nodes recursively, or the No button to
copy only the top level nodes.
3. The Copy Data dialog will open so that source objects may be mapped to target objects, and
source attributes to target attributes.
4. In our case, some Test Items are being dragged from DataHub explorer to MagicDraw® contain-
ment area. The Test Items node has been mapped to a MagicDraw® package type and the sub-
nodes have been mapped to a MagicDraw® business requirement type.
5. The result of the copy operation is as shown in Figure 21.

NOTE The Copy Data operation mode will not create any DHLink, thus,
when either the source or target objects change, the changes will not
propagate and the synchronization option will be unavailable.

Figure 20 -- Confirmation Dialog for Recursive Copy operation

22 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 21 -- Result of Copy Data operation

1.4.2.2 Copy Data with Sync

This DataHub operation type allows for data copy along with synchronization capabilities. Again, it is simply a
matter of dragging a source node to a target.

To Copy Data with Sync from DataHub to MagicDraw® containment area

1. First select Copy Data with Sync option from the DataHub explorer operation drop-down.
2. In this case, we will be copying some requirement objects from DOORS to MagicDraw’s contain-
ment area. We will choose Group Type Mapping mode.
3. Then, drag any node from DataHub explorer tree to the MagicDraw® containment area.
4. The Copy Data with Sync dialog will appear so that you can map the source node types to target
node types and source attributes to target attributes.
5. The Formal Module is mapped to a MagicDraw® Package type and the sub-nodes are mapped to
a business requirement object type.
6. The result of the copy operation is as shown in Figure 22.

23 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 22 -- Result of Copy Data with Sync

NOTE Data type mapping is normally required when moving data across tools. If any data
copying does not contain the DataHub pre-mapped template, DataHub will ask for addi-
tional mappings.

1.4.2.3 Create OSLC Link

The third DataHub operation is Create OSLC Link. OSLC links and queries can be created once you have an
IBM® Rational® DOORS® or IBM® Rational® DOORS® Next Generation data source open in DataHub.

OSLC Links can be created to IBM® Rational® DOORS® Next Generation artifacts repository.

To create an OSLC Link do the following

1. Select Create OSLC link from the DataHub operations drop-down on the DataHub explorer tab.
2. From an IBM® Rational® DOORS® Next Generation data source, drag and drop a node into the
MagicDraw® containment area.
3. A popup, Figure 23, will prompt you to choose a type of link. Select one from the list and a link of
that type will be created.
4. Figure 24 shows the newly created OSLC hyperlinks in the MagicDraw® containment tree. Fig-
ure 25 shows the OSLC hyperlink’s Properties and Figure 26 shows the OSLC hyperlink in the
DHLink panel.

24 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 23 -- Figure OSLC Link types

Figure 24 -- OSLC hyperlinks in MagicDraw® containment area

25 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 25 -- Properties of OSLC Link

Figure 26 -- OSLC Link in DHLink Panel

1.4.3 Create OSLC Query


In OSLC, each artifact in the lifecycle (for example, requirements, change requests, test cases) is identified by a
URI. Each artifact in the lifecycle is an HTTP resource. Standard HTTP methods (GET, PUT, POST, DELETE) are
used to interact with them. When someone looks up a URI, OSLC queries provide useful information using the
standards (RDF*, SPARQL). Each OSLC resource has an RDF representation. RDF/XML is mandatory and other
representations such as JSON or HTML are common. OSLC lifecycle artifacts are linked by relationships (for
example, elaborates or elaboratedBy) which are defined by URIs.

There are two types of OSLC queries you can construct to query an artifacts repository - simple or basic query and
a more advanced query based on SQL or SPARQL, details of which can be found on the OSLC Specification web-
site - http://open-services.net/.

To create and run a basic OSLC query, do the following:

1. Click Tools > DataHub > Create OSLC Query from MagicDraw® or click the Create OSLC
query icon in DataHub explorer. The OSLC query editor window should appear, Figure 27.
2. The OSLC query editor has two tabs - Basic Query and Query Editor

26 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

3. Basic queries are simple text search queries. You can search from the Title, Description, Cre-
ator, Created Date and Last Modified Date fields. Type your search term into the appropriate
check box and click the Run button.
4. The results will appear, Figure 27.

Figure 27 -- OSLC Query editor window

5. After the query results appear you can click the Save as alias button to save the results as the
alias.

To create and run an advanced query:

1. Click the Create OSLC Query button on the DataHub explorer toolbar.

27 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

2. Click the Query Editor tab, see Figure 28 below. In the Query String text box, type your query
which might look like https://host:port/rm/views?oslc.query=true or https://host:port/
bugs?oslc.select=dcterms:created,dcterms:creator{foaf:familyName}&oslc.where=cm:sever-
ity="high"
3. If the query returns any results, they will be displayed on the lower half of the OSLC Query Edi-
tor, Figure 28.
4. You can click the Save as Alias button to save the results as an alias.
5. More examples of queries and their syntax can be found on the OSLC Specification website.

Figure 28 -- The OSLC advanced Query Editor tab

28 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

1.4.4 Copying OSLC Query Results

1.4.4.1 Copy OSLC Query Results to MagicDraw® as SysML Requirements

To copy OSLC query results into MagicDraw® as SysML requirements, first you need to set up an IBM® Rational®
DOORS® Next Generation data source and then query the data source using OSLC query syntax. Once you have
the query results you can copy them into MagicDraw® as SysML requirements.

To copy OSLC query results as SysML requirements

1. From OSLC Query result pane, drag and drop the matched tree onto the MagicDraw® contain-
ment tree, Figure 29.
2. When the Copy Data dialog opens up, choose a Target type from the target type list as shown in
Figure 30. Click OK.
3. The result of the copy is as shown in Figure 31.

Figure 29 -- Copying OSLC Query result into MagicDraw®

29 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 30 -- Copying OSLC query result as Extended Requirement

30 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. GETTING STARTED WITH CAMEO DATAHUB
Basic Features of DataHub

Figure 31 -- Result of copying OSLC query result into MagicDraw® containment tree as SysML requirement

Figure 32 -- OSLC Query Editor Operations drop-down

Note The OSLC Query Editor only supports Copy Data and Create OSLC
Link as shown in Figure 32.

31 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


2. WORKING WITH DA TA HUB

2.1 How Synchronization Works


DataHub synchronization capability is a core feature of the DataHub.

Synchronization is primarily used for keeping track of changes.

2.1.1 Tracking DataHub Data Changes


As you copy data from various data sources, a few scenarios may arise, now that the data is present in two
locations. A user may choose to delete a node, edit it, move it to another location, or even add a new node. Right-
click the data source node on the DataHub explorer tree and chose to Check Node Changes or Check Node
Changes Recursively, Figure 33.

The Conflict Dashboard appears with all changes that need to be synchronized, Figure 34.

A simple color scheme exists for differentiating between different type of node changes. The following table
explains the meaning of the different colors.

NOTE The Conflict Dashboard will be displayed if you perform Check Node
Changes or Check Node Changes Recursively at any data source,
except MagicDraw® data source.

Table 1 -- Colors and their meaning in Conflict Dashboard


Green New Entity
Blue Modified entity
Yellow Moved node
Pink Deleted node
Gray Excluded node
Red Out of Scope node

The Conflict Dashboard allows you to resolve node changes by either synchronizing a node from source to target
or from target to source.

To synchronize nodes do the following

1. Select one of the check boxes on the left hand side, Figure 34. That side will become the master
data source and the other side will pick up the changes from it.
2. A single node can be synchronized from either source to target or target to source, but not both.
Different nodes, however, can have different synchronization directions. For example, one node
could be synchronized from source to target and another node could by synchronized from target
to source.
3. Click the Synchronize button when you are done selecting the appropriate check boxes.

32 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
How Synchronization Works

Figure 33 -- DataHub explorer - checking for node changes context menu

33 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
How Synchronization Works

Figure 34 -- DataHub Conflict Dashboard - node changes are color coded

2.1.2 Synchronization Options


DataHub has several Synchronize buttons. Depending on which Synchronize button is clicked, the
synchronization result is different. The different synchronization buttons are as follows:
®
• On top of MagicDraw containment area, Figure 35. Clicking this Synchronize button will render
®
the MagicDraw data source as the Master data source. A single node without children can be
synchronized or a node containing children can be synchronized recursively.
• On top of DataHub Explorer, Figure 36. Clicking this Synchronization button will render the
DataHub explorer’s selected node’s data source as the Master data source.
®
• From MagicDraw main menu, click Tools > DataHub > Synchronize, Figure 37. Choosing this
synchronization option will render the currently selected node and data source as the Master
node. If the selected node is on MagicDraw® containment, then its data source will become the
Master. If the currently selected node is from the DataHub explorer, then its data source will
become the Master node.
34 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.
. WORKING WITH DATAHUB
How Synchronization Works

®
• From MagicDraw context menu, Figure 38. Choosing this option will render the selected node in
®
the MagicDraw containment area as the Master.

Figure 35 -- Synchronize button on MagicDraw® containment area

Figure 36 -- Synchronize button on DataHub Explorer toolbar

35 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
How Synchronization Works

Figure 37 -- Synchronize option on MagicDraw® main menu

Figure 38 -- Synchronize option from MagicDraw’s context menu

36 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
How Synchronization Works

2.1.3 Sample Synchronization Scenario


Whenever there is updated data, DataHub provides functions to synchronize that data with other collaboration
tools. The direction of synchronization determines how the synchronization will occur. For bidirectional
synchronization - changes will be propagated on both sides. For unidirectional synchronization - changes will be
propagated from the master data source to the other side.

Here is a sample scenario that involves the use of MagicDraw® and DOORS:

1. Package Requirements that contains nodes “General Description”, “Introduction”, and “Specific
requirements” is created.
2. All nodes are copied from DOORS to MagicDraw® with associated DHLink.
3. Node "Introduction" from DOORS is updated to "Introduction Edit".

Figure 39 -- Synchronization from the Containment Tree with the Sync Button Indicated

4. If the synchronization is to be done from MagicDraw®, click the Sync button on the MagicDraw
Containment tree toolbar, Figure 39.
5. If the synchronization is to be done from Data Sources of other tools in the Cameo DataHub
Explorer, select any nodes then click the Sync button located next to the Operation list (Figure
40). The Data Source that contains the selected node(s) will be synchronized. If the target is differ-
ent from source, the target will be overwritten.
6. In this case, there is no updated data in MagicDraw®, so the operation will show that no change is
found.
7. However, if the synchronization is chosen to be done from DOORS (represented by DOORS Data
Source), right-click DOORS updated data or DOORS Data Source, and then select Synchronize.
8. DataHub will see the updated data "Introduction Edit" in DOORS and apply this updated data to
the related element in MagicDraw®.

37 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
How Synchronization Works

Figure 40 -- Synchronization from the DataHub Explorer with the Sync Button Indicated

NOTE In the case of synchronization from the Source to the Target, the data of the
target node is always replaced and updated even though both of them contain
their own updated data.

2.1.4 Recursive Synchronization


DataHub provides menus and buttons specially designed for data synchronization options. There are some differ-
ences among them in order to let the user synchronize a single node, group of nodes, or the entire Data Source.

38 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 41 -- Synchronize Menu on the Shortcut Menu

To synchronize selected node(s):

1. Select node(s).
2. Right-click the selected node(s) and select Synchronize > Synchronize Node.

To synchronize recursively on the selected node(s):

1. Select node(s).
2. Right-click the selected node(s) and select Synchronize > Synchronize Node Recursively.

To synchronize a particular Data Source, do one of the following:

• Select a particular Data Source node or any nodes under that Data Source. Click the
Synchronize button on the top-right of the Cameo DataHub Explorer.
• Right-click a particular Data Source node in the Cameo DataHub Explorer. Select Synchronize >
Synchronize Node Recursively, Figure 41.
• Click the Synchronize button on the top-right of the MagicDraw® Containment tree to
synchronize the MagicDraw® Data Sources in the current project.

2.2 More synchronization and Schema Mapping


options

2.2.1 One-way Synchronization


Synchronization updates data from one end of a DHLink to another. In a one-way synchronization, data flows in
only one direction. With one-way synchronization, you can either synchronize data from the source to the target or
from the target to the source. Nodes that are selected for a one-way synchronization will have the icon “1 S”
Figure 42.

39 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 42 -- Nodes Limited to One-way Synchronization Marked with “1” Icons

One-way synchronization updates data only in the direction specified in the Sync Direction option. For example,
if the sync direction is from the source to target, DataHub will synchronize updates that come from the source to
the target data. Therefore, if there are updates on the target side, they cannot be detected and a message saying
there are no changes to synchronize will appear.

To copy data with one-way synchronization:

1. Drag a source node to a target data. The Copy Data with Sync dialog will appear, Figure 43.

40 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 43 -- Sync Direction

2. Choose the direction of data for synchronization from the Sync Direction options Figure 43. The
selected sync direction will be applied to all nodes to copy.
3. Complete the schema mapping then click OK to start copying data.

41 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

To apply one-way or two-way Sync direction to any existing relations:

1. Double-click the root node of the DHLink hierarchy or right-click it and select Properties. The
Cameo DataHub DHLink panel will open.
2. Right-click the relation to which you want to apply one-way synchronization.
3. Select Change Direction, Figure 44 and click the Sync Direction that you want. The selected
sync direction will be recursively applied to all child nodes.

Figure 44 -- Changing Sync Direction through the Shortcut Menu

2.2.2 Checking for Node Changes Before Synchronizing Data


DataHub allows you to check for updates or changes without synchronizing data. You can do this by selecting the
Check Node Changes context menu on the DataHub action menu. You can check updates in either the target
node or the target node and its hierarchy.

To check for changes in a target node:

1. Right-click a target node.


2. Select Check Node Changes > Check Node Changes, Figure 45.

42 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 45 -- Check Node Changes Command in the DataHub Action Menu

NOTE The Check Node Change command also checks for changes in the hierarchy of the
node that has the DHLink.

To check for changes in a target node and its hierarchy:

1. Right-click a target node.


2. Select Check Node Changes > Check Node Changes Recursively, Figure 46.

43 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 46 -- Check Node Changes Recursively Command in the DataHub Action Menu

NOTE • The Check Node Changes Recursively command will be enabled only when the
selected node has hierarchy.
• The Pending Delete status can be detected in the Check Node Changes operation
by selecting the Data Source of deleted node(s) to perform the Check Node
Changes command.

2.2.3 Excluding Some Nodes in Copying Data


The Copy Data with Sync usability has been enhanced. It no longer requires you to map the whole set of data to
copy some. With Copy Data with Sync, DataHub will exclude data types that you do not map and these nodes
will not be copied. You have the options to exclude a portion of data prior to copy and include them later.

To exclude a portion of data while copying with DHLink:

1. Use the Copy Data with Sync operation in DataHub Explorer.


2. Map the data types that you need to copy. To exclude nodes from being copied, select the
<UNSPECIFIED> target type, Figure 47.
3. Then, select the Exclude all unmapped nodes from DHLink check box.

44 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 47 -- Exclude All Unmapped Nodes

4. The OK button will be enabled for you to continue copying.


5. Copied data will be indicated with an "S" symbol and the data which is not copied will be indicated
with an “X” symbol, Figure 48.

45 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 48 -- Excludes Nodes

To include previously excluded data into a scope set:

1. Double click a node marked with an "X". The DHLink Panel will appear.
2. Right-click over the relation table and select Include Node, Figure 49.

Figure 49 -- Include a Node

46 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

3. The next time you synchronize data, DataHub will recognize it as a newly added node to target
side.

2.2.4 Synchronizing Changes in Data Hierarchy


The functionality of DHLink feature has been simplified, with the DHLink map now being stored along with the
project, to avoid conflicts in multi-user scenarios. The synchronization does not limit only for attribute values.
When nodes are moved within the scope, synchronization will take care of the changes in hierarchy too, Figure
50.

Figure 50 -- Synchronizing Changes in Data Hierarchy

47 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

2.2.5 Synchronizing Changes in Schema Mapping


Besides synchronizing changes in nodes and data hierarchy, DataHub can also synchronize updates on a schema
map. If you change a schema map, synchronization will search for affected nodes in the schema map and update
them.

Figure 51 -- Saving an Edited Schema Map

48 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 52 -- Confirmation to Synchronize when a Schema Map is Changed

2.2.6 Group Type Mapping


The Group Type Mapping mode arranges node into groups in the Source Tree. DataHub sorts the nodes by their
types. With Group Type Mapping, you will not see each individual node in a tree-view. Therefore, you will take less
time to finish mapping the nodes.

To use group type mapping:

1. Select Copy Data or Copy Data with Sync from the DataHub operations drop-down.
2. Select Group Type Mapping from the Mapping Mode option in the Copy Data dialog, Figure 53.

49 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 53 -- Change Mapping Type

3. Select a source node type and a target node type.


4. Complete the attributes mapping.
5. Continue mapping all of the data types.
6. Once you finish, click the OK button, Figure 53.

2.2.7 Defining the Target Type from an Attribute's Value


The functionality of synchronization has been simplified. The synchronization will not limit only to a simple type to
type mapping and attribute to attribute mapping. Target node type can be defined dynamically according to a
specified attribute's value.

50 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

To copy data and define target node type by attribute's value:

1. Use any DataHub operation to copy data.


2. Select Group Type Mapping from the Mapping Mode option in the Copy Data dialog, Figure 54.

Figure 54 -- Group Type Mapping

3. Select a source node type to start mapping.


4. Check the Define Target Type from Attribute Value check box, Figure 55.
5. Choose an attribute that will be used to define a target node type.

51 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 55 -- Map Source Type with an Attribute

6. Specify the attribute’s value to do the mapping.


• If the attribute is Enumeration, you can select the value from a drop-down menu,
Figure 56.
• If the attribute is a simple data type, you can type any expected value in the Value
box.

52 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 56 -- Specify an Attribute Value to Do Mapping

7. Choose a target node type for that value from the Target Type box on the right-hand side.
8. Continue mapping the attributes.

53 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 57 -- Map Attribute Value with Target Type

9. Click the Add button to enter more value for mapping.


10. Complete all steps above to map each attribute’s value.

54 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. WORKING WITH DATAHUB
More synchronization and Schema Mapping options

Figure 58 -- Map All Attribute Value

11. Click the OK button to start copying.

NOTE: • The functionality to map between Attribute value and Target type is
available only in Group Type Mapping.
• At least 2 values have to be identified for mapping.
• The attribute that is used to define a target type will be dedicated
only for this purpose. It will bound to the target type and will no
longer be available for the schema mapping.
• The mapping can be edited or deactivated in the Schema Map
Manager dialog.

55 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


3. M OR E D ATA HUB FE A TURE S

3.1 Creating an Alias


One of the features of DataHub is that it lets you work with Aliases.

An alias is a reference to a particular node within a particular data source, or OSLC query result. When you create
an alias a short cut is created to the contents of the node and it becomes available separately in an explorer tab, to
view only that node.

You can create an alias for a data source, node, or OSLC query result.

To create an alias

1. Right-click the node or data source and select Create Alias, See Figure 59.
2. The Alias will be created for that node and it will become available in a separate Alias explorer tab,
Figure 60.

Figure 59 -- The Create Alias context menu item

56 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Creating an Alias

Figure 60 -- DataHub Alias Explorer

3.1.1 Working with the Alias Manager


The Alias Manager enables you to manage all aliases in the system.

To open the Alias Manager:

1. Click Tools > DataHub > Alias Manager, Figure 61, to open up the Alias Manager dialog.
2. The Alias manager lets you manage all aliases. You can either remove or open them, Figure 62.

57 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Creating an Alias

Figure 61 -- The DataHub Alias Manager menu item

58 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Working with DHLink Panel

Figure 62 -- DataHub Alias Manager

3.2 Working with DHLink Panel


The Copy Data with Sync operation mode creates DHLink. DHLink provides a mechanism for synchronization
by marking which node has been edited, deleted, moved, or if a new node has been added, after a copy operation.

You can view DHLink from the DHLink Panel.

To open the DHLink Panel:

1. Click Tools > DataHub > DHLink Panel. The DHLink Panel will open, Figure 63.
2. Right-clicking a node in the DHLink panel yields a context menu, Figure 64.
3. The menu items in the context menu are
• View Schema Map - this opens the Schema Map dialog, Figure 65.
• Change Direction - Two-way Sync, Source to Target only and Target to Source
only - this option changes the current direction of synchronization.
• Remove DHLink - removes the DHLink.
• Select in Application - selects the node in the original application window - if the node
was originally from DOORS - this option will open the node in the DOORS client
application.
• Select in DataHub/Alias Explorer - this selects the node in the DataHub/Alias explorer
4. If you right-click the last column in the DHLink panel, a different context menu opens up. The
items in this menu are View Schema Map, Change direction, and Remove DHLink.

59 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Working with DHLink Panel

Figure 63 -- DataHub DHLink Panel

Figure 64 -- DHLink Panel context menu

60 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Working with Clean Up DataHub Database menu

Figure 65 -- View Schema map from DHLink panel

3.3 Working with Clean Up DataHub Database menu


This feature of DataHub is accessible from MagicDraw’s DataHub menu, Figure 66.

61 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Working with Clean Up DataHub Database menu

Figure 66 -- Clean Up DataHub Database menu item

While copying data with Sync from various data sources in DataHub, the DataHub creates DHLink to be used for
synchronization. As you work with more data - the DHLink will keep building up within the DataHub project in
MagicDraw® containment area. If some of these DHLink are deleted from DataHub explorer, the references will
still exist within MagicDraw’s project space. Clean Up DataHub Database will remove these unused references
from the MagicDraw® project.

To clean up DataHub database

1. First select the DataHub_Data_projectname folder from the containment area.


2. Then click Tools > DataHub > Clean Up DataHub Database, Figure 66.
3. If there are unused references or unused DHLink, they will be deleted. Otherwise, a message
saying there is no unused DHLink will open.
4. The result of the clean up operation is shown in Figure 67.

62 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
Working with Schema Map Manager

Figure 67 -- Clean Up DataHub Database results

3.4 Working with Schema Map Manager


Schema maps are used while copying data. They enable mapping of source types to target types, and also source
attributes to target attributes.

To open the schema map manager

1. Click Tools > DataHub > Schema Map Manager from MagicDraw® main menu.
2. The schema map manager dialog will appear as shown in Figure 68.
3. The schema map manager enables you to view all of the schema maps available in the system
and it also allows you to edit a schema map, import a new schema map, or copy the current
schema map.

63 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
UI Components of the Schema Map Manager

Figure 68 -- DataHub Schema Map Manager

3.5 UI Components of the Schema Map Manager


The Schema Map Manager has the following UI components:

1. Source Type and Target Type - these are all the source and target types from all data sources
currently in the system.
2. Set as Default - clicking this button will set the current schema configuration as the default one.
As soon as you click this button, the button’s text will change to Remove Default. Clicking the
Remove Default button will remove the schema configuration from the selected source and target
types.
3. Deactivate - Activates or de-activates the selected Define Target Type From Attribute Value
schema. This only applies to Define Target Type From Attribute Value mapping option.
4. Delete - clicking this button will delete the current schema configuration.
5. Edit, Save and Cancel buttons - these are used to edit a schema map, and save it, or cancel the
editing of the schema map.
6. Import - clicking this button will open a file browsing dialog which will let you choose a schema
map file for import.

64 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
UI Components of the Schema Map Manager

7. Export - clicking this button will open the schema export wizard which will guide you to export the
current schema to a file on your file system. Step one of the wizard shown in Figure 69, lets you
choose the source and target types. Step two of the export schema map wizard is shown in Figure
70, this step lets you choose a schema map for export. Select a check box from the right and click
the Next button. The third screen of the export schema map wizard is shown in Figure 71. This
step lets you choose a schema name and the schema file to export to. Optionally you can even
add a short description of the schema.
8. Close - clicking this button will close the schema map manager dialog.

Figure 69 -- Schema Map Manager’s export wizard - step one - choosing source and target types

65 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. MORE DATAHUB FEATURES
UI Components of the Schema Map Manager

Figure 70 -- Schema Map Manager’s export wizard - step two - choosing an existing schema to export

Figure 71 -- Schema Map Manager’s export wizard - step three - choosing a schema name and file name and path

66 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


4. USEFUL S CE NA RIOS

4.1 Working with CSV Data Source

4.1.1 Retrieving New Data from CSV File


Once you add a CSV file as a Data Source, DataHub will retrieve information from the CSV file, store it in the
memory, and use data from the file to populate a treeview in the DataHub Explorer tab. While connecting to
DataHub, a CSV file may receive updates from other users. DataHub cannot incorporate these updates into
DataHub Explorer automatically. You need to reload the CSV Data Source in order to allow DataHub to refresh its
memory and include the new data in the DataHub Explorer tab.

For example, new data Importing Module from Teamwork is added to a CSV file Figure 72. But, it does not show
in DataHub Explorer because DataHub needs to reload it first into its memory in order to include it in a treeview in
the DataHub Explorer tab.

Figure 72 -- New data is added in CSV file

To include new data in DataHub Explorer by reloading a CSV data source:

1. Right-click the CSV Data Source in the DataHub Explorer tab, Figure 73.

67 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with CSV Data Source

Figure 73 -- Reloading CSV Data Source

2. Select Reload to reload the CSV Data Source. New data from the CSV file will appear in DataHub
Explorer, Figure 74.

Figure 74 -- The CSV Data Source Includes New Data in DataHub Explorer after Reloading

NOTE: • Reloading a CSV Data Source will refresh the treeview in DataHub
Explorer.
• You need to save your work on the nodes you are currently editing
before reloading the CSV Data Source. Otherwise new data will
overwrite your unsaved work.

68 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with CSV Data Source

4.1.2 Saving New Data into CSV Data Source


DataHub reads all data from a CSV file that is stored in the memory, and populate a treeview in DataHub Explorer.
Whenever a CSV Data Source reloads new data from a CSV file into the DataHub’s memory, that particular
information will appear in the treeview.

Now if you change or update some data in the CSV Data Source through the treeview, DataHub will not save that
piece of information automatically into the CSV file. You need to save it manually through the Save context menu
in order to save those updates on the CSV Data Source into the CSV file.

For example, we have deleted nodes Category Types and Creating New Teamwork Projects from the CSV
Data Source through the treeview. But, they are still present in the corresponding CSV file because DataHub does
not save updates on the CSV Data Source to the CSV file automatically, and vice versa, Figure 75.

Figure 75 -- Updated Data in CSV Data Source

To save updates on the CSV Data Source into the CSV file:

• Right-click the CSV Data Source in the treeview in DataHub Explorer and click Save, Figure 76.
DataHub will update the CSV file with new data from the CSV Data Source, Figure 77.

Figure 76 -- Saving Data on the CSV Data Source to the CSV File

69 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with DHLink Summary Report

Figure 77 -- The CSV File is Updated with New Data from the CSV Data Source

4.2 Working with DHLink Summary Report


The DHLink Summary dialog allows you to preview specific relation types and their scope, and produce a report
that contains the selected relations in HTML format. This report is called a Relation Summary report.

The following are the functions of the DHLink Summary dialog:


• to provide the options to extract specific relations from a project and to preview them.
• to save the relations.
• to create a report, which contains the selected relations, in HTML format.

To preview relations in the DHLink Summary dialog:

1. On the main menu, click Tools > DataHub > DHLink Summary. The Cameo DataHub DHLink
Summary dialog will open.
2. Select a Relation Type and a scope of Data Source.
3. Click the View button to preview the selected data.

70 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with DHLink Summary Report

Figure 78 -- Previewing Relation Summary

To save the relations that you want to include in a report and/or create a report in HTML format:

1. On the main menu, click Tools > DataHub > DHLink Summary. The Cameo DataHub DHLink
Summary dialog will open, Figure 78.
2. Select either DHLink or No DHLink check boxes. Select the Data Source check boxes you want.
3. Either click (i) Save to save the selected data or (ii) Generate to produce an HTML report, Figure
79.

71 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with DHLink Summary Report

Figure 79 -- Generated Relation Summary Report

4.2.1 Working with the Report Template


DataHub uses template code from its report template to create the layout and details of a DHLink Summary report.
You can find the report template file in plugins/com.nomagic.datahub.magicdraw/data/templates/relation.html.
Figure 80 below shows template code inside the template file and the construction of the report layout and data
script.

72 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with DHLink Summary Report

Figure 80 -- The Inside of a Report Template

You can edit the template file in order to add more information into the report template.

To add more information into the report template:

1. Open the template file in any text editor or WYSIWYG editor.


2. Use the following format to add more attributes into the file. You need to replace “Surname” with
the attribute's name. The name will be the same as the one appears in the Cameo DataHub
Properties tab, Figure 81.
$DataHubReportEngine.decorateHTMLTag($row.sourceElement.entity.getAttributeValue("Obje
ct Heading"))

3. Save the template file and generate a report.

Figure 82, shows how to add the attributes Object Heading into the report template file in order to include them in
the relation summary report.

Figure 83, shows the DHLink summary report that is created by customizing the report template.

73 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with DHLink Summary Report

Figure 81 -- DataHub Attribute’s Name

Figure 82 -- Adding Attributes into Report Template

74 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.


. USEFUL SCENARIOS
Working with DHLink Summary Report

Figure 83 -- The Customized Relation Summary Report

4.2.2 Copying Data with Custom Types and Properties


Elements in the source and the target data normally contain different sets of attributes. In order to have matching
attributes when copying data across tools, you need to prepare custom attributes for the target types before
copying data so that new custom attributes will be available during data copy.

To prepare custom attributes for Requirement elements in MagicDraw®:

1. Create a new Stereotype, for example, <<doors_attr>>.


2. Add properties to <<doors_attr>>, for example, Custom1 and Custom2. These properties are
custom attributes.
3. Create a dummy Requirement.
4. Right-click it and select Stereotype.
5. Search for <<doors_attr>> and select the stereotype.
6. The custom data type is now ready for DataHub. This data type will be available for you to select
in the Copy Data dialog.
7. When you select this data type as the target type, the custom attributes Custom1 and Custom2
will be available.

75 Copyright © 2008-2015 by No Magic, Inc. All rights reserved.

Das könnte Ihnen auch gefallen