Using SysML – Teamcenter Mappings.
The new learning objective of this exercise are to explore and use existing SysML_Teamcenter mappings for Data Map and Model Transform connections.
This exercise assumes the student has
- IBM Rational Rhapsody 8.2 installed correctly on his or her machine with a valid license for use, and
- Syndeia 3.2 installed as a plugin for Rhapsody with a valid license for use
- Syndeia Teamcenter interface, correctly installed with a valid license for user.
We will use the provided Rhapsody project Syndeia_Teamcenter_Mapping_Tutorial.rpy. The user can use any Teamcenter repository they have available with the ability to create and edit issues within a Teamcenter folder. 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_Rh.mappings, which contains the specific starting mappings used in this and the following exercises. To install this,
- Close Rhapsody, if it is open
- Rename the existing syndeia.mappings file in the .syndeia folder to something like syndeiaOld.mappings
- Copy syndeiaTutorial_Rh.mappings into the .syndeia folder
- Rename syndeiaTutorial_Rh.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.sbs, which is loaded into a TutorialMappingProfile folder in the profiles folder of Syndeia installation:
C:\Users\<account>\<Rhapsody installation> \Share\Profiles\Syndeia\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) and create mappings using them (as described in Exercise 11.7).
Caution: Rhapsody has, by default, restrictions on the naming of SysML elements, which can create problems when Syndeia tries to create Rhapsody model elements that violate these restriction, e.g. beginning a SysML block name with a number. We recommend modifying any Rhapsody models you create to relax these restrictions. Modify the properties of the top-level package of the model under General::Model::NamesRegExp with the following string and save.
^(([a-zA-Z0-9_][a-zA-Z0-9_ ():-]*)|(operator.+))$
Exercise
- Open the SysML project Syndeia_Teamcenter_Mapping_Tutorial.rpy, right-click the Teamcenter package, and launch the Syndeia dashboard.
- Go to the Settings tab (Figure 1) and check the Use mapping element under the General heading, if not already checked. Click Apply.
- Go to the Mappings tab. The contents of the main area on the right will depend on the element selected on the left. Expand Mapping Groups and select SysML-Teamcenter on the left to see the existing mappings in this area (Figure 2).
- The first task is to drag a hierarchy of SysML blocks into Teamcenter to create multiple Teamcenter items.
- Set Connection Type to Model Transform in the central column
- Drag the Block_A block onto the empty target Teamcenter folder (Demo 3 here).
- Select Block-Item (no attributes) and click OK (Figure 3).
- We can view the new Teamcenter items created by expanding the right side of the Connection Manager (see Figure 4). Teamcenter has assigned new id’s to these items, but the structure from the SysML block structure is preserved.
- In the second example, we will use a different mapping when we drag the Teamcenter items back into SysML.
- Return to the Mappings tab in the Syndeia dashboard and select the mapping Block – Item (attributes) in the left column (Figure 5). At the bottom right, we see that this mapping is associated with a new SysML stereotype, <<Intercax_Artifact>>, which contains a set of tag values corresponding to some of the attributes of an Item in Teamcenter. On the right side under Attribute Definition Mappings, there is a table showing the desired mappings between the SysML (Source) element tag values and the Teamcenter (Target) attributes.
- In the Syndeia dashboard, Connection Manager tab, select the Model Transform connection type, drag the 002586-Block_A item into an empty SysML package (T3 in this example), and select the Block -Item (attributes) mapping.
- You can view the new blocks created in Rhapsody. It should appear similar to Figure 6. The <<Intercax _Artifact>> stereotype has been applied and the associated tag values have been added. Some of those tags (id, rev, and type) have been populated with default values by Teamcenter when the blocks were created earlier.
- Return to the Mappings tab in the Syndeia dashboard and select the mapping Block – Item (attributes) in the left column (Figure 5). At the bottom right, we see that this mapping is associated with a new SysML stereotype, <<Intercax_Artifact>>, which contains a set of tag values corresponding to some of the attributes of an Item in Teamcenter. On the right side under Attribute Definition Mappings, there is a table showing the desired mappings between the SysML (Source) element tag values and the Teamcenter (Target) attributes.
- Use Syndeia’s Compare and Sync capabilities to change the SysML model and push the changes to Teamcenter.
- Create the tag value “USA” in govClass in Block_A in SysML. Do not use HTML formatting.
- Delete part property a2:Block_A2 in SysML.
- In the Syndeia dashboard, Connection Browser tab, find the connection from T3::Block_A to Teamcenter (Figure 7). Right-click this row and select Compare Source & Target.
- The Comparison Result tab will show the differences between the SysML and Teamcenter models (Figure 8). The difference table shows that the SysML model is missing the child part of type Block_A2 and has a value for the govClass attribute.
- Return to the Syndeia dashboard, Connection Browser tab, and the connection from T3::Block_A to Teamcenter (Figure 7). Right-click this row and select Sync Source to Target.
- Repeat the comparison and see that the differences in govClass and part structure have been resolved by updating the Teamcenter model.