Exercise 11.9 - Model Transform Teamcenter to SysML with Value Properties
Objectives
The objectives of this exercise are as follows:
Add a new Teamcenter artifact type in the Syndeia mappings tab
Add a new SysML artifact type with the attribute definition set to ‘value property’
Add a new SysML-Teamcenter mapping that shows attributes as value properties instead of tag values in SysML
Use this new mapping in a Model Transform from Teamcenter to SysML
Preparation
This exercise assumes the student has:
Cameo System Modeler (or MagicDraw with SysML plug-in) supported version installed correctly on his or her machine with a valid license for use, and
Syndeia 3.6 or later installed as a plugin for Cameo/MagicDraw with a valid license for use
Syndeia Teamcenter interface, correctly installed with a valid license for user.
A Teamcenter repository network connection in the Syndeia Repository Manager
Completed previous Teamcenter Model Transform and mapping building exercises such as 11.3, 11.6, and 11.8: Part 11 - SysML-Teamcenter Capabilities
The user can use any Teamcenter repository network connection they have available. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes.
Exercise
This exercise assumes the user has access to the SysML model Syndeia_Teamcenter_Mapping_Tutorial.mdzip (get it here - SysML Models, Profiles and Mappings) and their Teamcenter repository.
Go to the Settings tab (Figure 1) and check the Use mapping element under the General heading, if not already checked. Click Apply.
We will now make a new Teamcenter artifact type available for mapping. Go to the Mappings tab in the Syndeia dashboard and find the Teamcenter icon underneath Syndeia Mappings. Right-click Teamcenter and select Add Artifact Type a shown in Figure 2 below.
A new window appears, 'Add Teamcenter Artifact Type.' Select your repository in the first dropdown menu and then begin entering the ID of the Teamcenter Item type you would like to add. After entering the ID, select the Get Teamcenter Item Type button and Syndeia will automatically populate the ID/Type/Name/Description below as shown in Figure 3.
Figure 3 - Enter the ID of the Teamcenter artifact and click ‘Get Teamcenter Item Type’
Once you are satisfied with the Name and Description of your new Teamcenter artifact, click the Retrieve Teamcenter Item Properties button to pull in all available artifact attributes as shown in Figure 4 below. Select the ones specifically of value by clicking the check box next to each, or you can Select All to bring in all attributes of the artifact. Click OK when finished.
When returning to the mapping screen, you should now see the new Teamcenter artifact type added on the left hand side shown in Figure 5. In this case, we added Part.
We will now add a new artifact type under the SysML heading on the left hand side of the mapping tab. Right click SysML and select Add Artifact Type from the menu as shown in Figure 6.
In the Add Artifact Type window that appears as shown below in Figure 7, set Type to Block and set Name, Block (TC Part) in this example, and Description as desired. Click OK.
Return to the Mappings tab and underneath the SysML group of elements, you will see the new artifact type you have just created in the above step. Right click on it and select Add/Edit Attribute Definition as shown in Figure 8.
Use the + button to add an additional line for each value property you would like available to map to Teamcenter properties. Enter the Display name/Internal Name/Description for each new attribute, and enter ValueProperty as the Meta Type as shown in Figure 9 below. In this example, we have added item_id, item_type, and revision. Click OK when finished.
The next task is to create a new mapping using the new Teamcenter and SysML model element types. Right-click SysML - Teamcenter under Mapping Groups in the left column and select Add Mapping shown in Figure 10.
In the window shown below in Figure 11, set a name and description reflecting the SysML and Teamcenter artifact type you are using along with any other information about the mapping you wish to preserve.
Set the Source Artifact Type to the new SysML element you created and set the Target Artifact type to the Teamcenter artifact you created. (i.e. Part)
Set the Structure level to CHILDREN_RECURSIVE and set Include Attributes to Include Attributes
For stereotypes, click the + button and add the Intercax_Artifact stereotype from the Syndeia Mapping Tutorial profile (shown in Figure 12)
Further down in the mapping screen as shown in Figure 13, select the Retrieve Available Attribute Definitions button first. Second, click the + button to the left and start mapping the attributes that we added as new value properties from the left column (SysML) to the attributes on the right column (Teamcenter). Lastly, save the mapping when finished at the bottom.
Now that we have the mapping ready, we will need to have an existing Teamcenter part structure to use it. In Figure 14 below, we have a sample ‘Turret Ring Assembly’ composed of Part item types. For each part in the structure, we have populated the ID/Revision/Revision Name.
Return to the Syndeia client dashboard and go to the Connection Manager tab as shown in Figure 15. Select the SysML repository and create an empty package in the SysML model on the left. In our example, it is called ‘Demo1’ package. On the right column, select the Teamcenter repository and select the artifact of interest. In this example, it is the ‘Turret Ring Assembly.’ Set the Connection Type to Model Transform.
With Model Transform Connection Type selected, drag the Teamcenter Part onto the empty Cameo Package ‘Demo1’ as shown below in Figure 16. Then, select the new mapping spec you created earlier in the dropdown and click OK. In this example, it is called Block - TC Part.
In Cameo/MagicDraw, you will now see the SysML Blocks generated from the Model Transform underneath the package in the containment tree as shown in Figure 17.
Create a block definition diagram in Cameo of the block structure as shown below in Figure 18. Drag the child part blocks from the parts compartment of the parent block. You will see that the 3 value properties for item_id/item_type/revision are displayed on each block symbol. The values for each property have been mapped from Teamcenter.
Double-click a block in the diagram (in our case it is Turret Ring Assembly) and go to Properties as shown in Figure 19.
Return to the Syndeia dashboard and go to the Connection Browser tab. With the SysML repository selected at the top, find the connection under the Parent block and right click (in this example it is 'Turret Ring Assembly'). Select Compare Source & Target from the menu as shown in Figure 20.
The Comparison Result screen should show a green result that indicates all values are synchronized as shown in Figure 21.