Creating SysML – Teamcenter Mappings
The new learning objective of this exercise is to create new SysML_Teamcenter mappings for Data Map and Model Transform connections. This is intended for an advanced user who will create new mappings that will be used by other members of the organization.
This exercise assumes the student has
- Cameo System Modeler 18.5 (or MagicDraw 18.5 with SysML plug-in) installed correctly on his or her machine with a valid license for use, and
- Syndeia 3.2 installed as a plugin for Cameo/MagicDraw with a valid license for use
- Syndeia Teamcenter interface, correctly installed with a valid license for user
- Syndeia Mappings license, to modify syndeia.mappings file from the Syndeia dashboard (without the special mappings license, existing mappings can be used, but not modified)
We will use the provided MagicDraw project Syndeia_Teamcenter_Mapping_Tutorial.mdzip. The user can use any Teamcenter repository they have available with the ability to create and edit items within a Teamcenter Bill-of-Materials. It is generally advisable to carry out these exercises in a non-production repository, a “sandbox”, set up for training and practice purposes.
Using mapping in Syndeia requires two new elements which are provided with these tutorials
- A mappings file, syndeiaTutorial.mappings, which contains the specific starting mappings used in this and the following exercises. To install this,
- Close MagicDraw, if it is open
- Rename the existing syndeia.mappings file in the .syndeia folder to something like syndeiaOld.mappings
- Copy syndeiaTutorial.mappings into the .syndeia folder
- Rename syndeiaTutorial.mappings as syndeia.mappings
- When you have completed the mapping tutorial exercises, you may want to reverse this process to restore the original mappings file.
- A mappings profile, SyndeiaTutorialMapping.mdzip, which is loaded like other profiles
Any Syndeia user can use or view the mapping specifications, but Syndeia requires a special license in addition to the regular Syndeia license in order to create, modify or delete mapping information. It is good practice to confine this duty to a very limited number of experienced users or system administrators, who will provide mappings for the general users. Some mappings require a special SysML stereotype to correctly transform attributes to or from a SysML element, so each mappings file should be paired with a SysML profile that holds the required stereotypes, as we have done here.
Many organizations customize their Teamcenter installation, creating new artifact and relationship types for their purposes. This tutorial exercise uses common artifact types in a standard Teamcenter installation, but you may need to adapt the instructions if these artifact types are not available to you. Prior to your doing this exercise, a user with the mapping license described above will need to register new artifact types for mapping (as described in Exercise 11.8).
Exercise
- Open the SysML project Syndeia_Teamcenter_Mapping_Tutorial.mdzip, right-click the Teamcenter package, and launch the Syndeia dashboard
- Go to the Mappings tab. The first task will be to create a new mapping using existing artifacts.
- Right-click SysML-Teamcenter under Mapping Groups in the left column and select Add Mapping.
- Initially, the window should appear similar to Figure 1.
- Modify the Mapping
- Change Name to Activity – Item (no attributes)
- Change Description to SysML Activity – Teamcenter Item with no attributes
- Change Source Artifact Type to Activity, using pull-down menu
- Set Target Artifact Type to Item, using pull-down menu
- Set Structure Level to CHILDREN_RECURSIVE, using pull-down menu
- Set Include Attributes to Exclude Attributes, using pull-down menu
- The window should look similar to Figure 2.
- Click Save Mapping at bottom of right side (scroll down if necessary).
- Use the new Mapping you just created
- Go to the Connection Manager tab. Open a Teamcenter repository in the right column.
- Drag the T2::Feature_Auto activity in the SysML model into an empty folder in Teamcenter (Demo 2 in this example).
- A small pull-down menu will appear on the Syndeia dashboard, as Figure 3, showing the possible mappings available for an activity dragged into Teamcenter.
- Select Activity – Item (No attributes) and click OK.
- Expand the Demo 2 folder on the right side of the Connection Manager. Check that a new set of items has been created with default attribute values assigned by Teamcenter.
- The second task is to create another new mapping, this one with attributes shared between the SysML and Teamcenter elements. We will use the Clone Mapping command rather Add Mapping. Clone Mapping saves time when not all features of the new mapping need to be modified.
- Right-click Activity – Item (no Attributes) under Mapping Groups/SysML - Teamcenter in the left column and select Clone Mapping
- Initially, the window should appear similar to Figure 4.
- Modify the Mapping
- Change Name to Activity – Item (attributes)
- Change Description to SysML Activity – Teamcenter Item with attributes
- Keep Source Artifact Type as Activity and Target Artifact Type as Item
- Set Structure Level to NO_CHILDREN, using pull-down menu
- Set Include Attributes to Include Attributes, using pull-down menu
- At the bottom of the right side, click the + sign box under the Stereotypes table.
- A Select stereotype window will open. The window should look similar to Figure 5.
- Select Intercax_Artifact. This choice will appear in the Stereotype box on the right.
- Scroll up to Attribute Definition Mappings
- Click Retrieve Available Attribute Definitions
- Click the + box below the Attribute Definition Mappings box.
- In the new row, select item_id on the right (Target) side of the table, using the pull-down menu
- In the new row, select id [owner: Stereotype (Intercax_Artifact)] on the left (Source) side of the table.
- Repeat steps xi through xiii for object_type and Gov Classification. The final table should look like Figure 6.
- Click Save Mapping at bottom of right side (scroll down if necessary).
- Use the cloned Mapping you just created
- Go to the Connection Manager tab. Open the Teamcenter repository you used above in the right column.
- Drag the Feature_AutoInit Teamcenter item created earlier into the empty SysML T4
- A small pull-down menu will appear on the Syndeia dashboard, as in Figure 7, showing the possible mappings available for an item dragged into SysML.
- Select Activity – Item (attributes) and click OK.
- A new activity (named Feature_AutoInit) should appear under T4 on the SysML side. It will have the <<Intercax_artifact>> stereotype in addition to Activity and all the tag values associated with that stereotype. However, only the id and type attributes mapped in the Activity – New Item (attributes) mapping have been populated in the SysML element from the Teamcenter item (see Figure 8).
Note that SysML activities do not normally have any place to receive the Teamcenter attributes. Because the <<Intercax_artifact>> stereotype was chosen in the new mapping definition, the new activity was created with that additional stereotype and tag values ready to receive the desired Teamcenter attributes. - Modify the new SysML activity to demonstrate compare and sync features of mapped attributes.
- In SysML, add a value (e.g. USA) to the govClass tag using the specification window. Do not use HTML formatting.
- In the Syndeia dashboard, Connection Browser tab, find the connection from T4::Feature_AutoInit to Teamcenter (Figure 9). Right-click this row and select Compare Source & Target.
- The Comparison Result tab will show the differences between the SysML and Teamcenter models (Figure 10). The difference table shows that the SysML model has a value for the govClass attribute.
- Return to the Syndeia dashboard, Connection Browser tab, and the connection from T4::Feature_AutoInit to Teamcenter (Figure 9). Right-click this row and select Sync Source to Target.
- Repeat the comparison and see that all differences have been resolved by updating the Teamcenter model.