Exercise 11.10 - Using Teamcenter Model Transform with Mixed Artifact Types
Objectives
The objectives of this exercise are as follows:
Add new Teamcenter artifact types (item types) that are used in a Teamcenter item BOM.
Add new SysML - Teamcenter mappings for each of Teamcenter artifact (item) types used in the BOM.
Set the parent SysML - Teamcenter mapping to use other mappings relevant for the Teamcenter BOM item types.
Perform SysML → Teamcenter, or vice versa, model transform using these mappings.
Compare and bi-directionally synchronize changes (using these mappings).
Preparation
This exercise assumes the user 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,
Syndeia 3.6 SP2 or later installed as a plugin for Cameo/MagicDraw with a valid license for use
Syndeia Cameo plugin is configured to connect with Teamcenter. Refer to instructions here: https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330093134.
Teamcenter repository is available to use and has been added in the Syndeia dashboard > Repository Manager tab. Refer to the instructions on this page: https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330094024.
Completed previous Teamcenter Model Transform and mapping building exercises such as 11.3, 11.6, 11.7, and 11.8 under part 11: https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330102866
The user can use any Teamcenter repository they have available. It is generally advisable to carry out these exercises in a non-production repository, (e.g. a sandbox) that is set up for training purposes before deploying this approach in your production environment. This will help you try out different mapping scenarios with test data before using the mappings for production.
Exercise
Before starting with using Syndeia, please create a simple bill-of-material (BOM) structure for an item revision in Teamcenter that uses multiple item types a shown in Figure 1. We recommend using the example below.
Block A item is of item type Item. It uses other items (as below) of three different item types.
It uses Block B and Block C items of item type Item
It uses Part 1 and Part 2 items of item type Part
It uses Design 1 item of item type Design
Open the sample tutorial model in Cameo. If you do not have it, you can download it from this link: https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330096164.
Right click the Teamcenter package in the Containment tree and select Syndeia → Dashboard to launch the Syndeia Dashboard shown below in Figure 2. Select a Syndeia Cloud project assuming that your Syndeia Cameo plugin is connected to Syndeia Cloud (highly recommended). Refer to details here: https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330093354.
Confirm from the Repository Manager tab that you have added a Teamcenter repository and are able to connect to it as mentioned above in the Preparation section.
Go to the Mappings tab. Underneath model types, right-click Teamcenter model type and select Add Artifact Type, as shown in Figure 3 below.
Before we can create a mapping between SysML element type and Teamcenter item type, we need to add the Teamcenter item type in Syndeia client and fetch its available properties. In Teamcenter, there is no generic way to fetch all the available properties of an item type, so if you can provide the item id of an item of the given type, then Syndeia can fetch those properties. In the Add Teamcenter Artifact Type window, 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 4. Next, click the ‘Retrieve Teamcenter Item Properties’ button to select and choose which attributes you want to use. Click 'Ok’ when you are finished.
Repeat step 6 to add Design and Part Artifact types. The end result should look like Figure 5 below.
We will now add the new SysML Block artifacts to use in our mapping so that we can sync attributes bi-directionally. Return to the mappings tab. Underneath model types, right-click SysML and select Add Artifact Type, as shown in Figure 6 below.
In the Add Artifact Type window, fill the following fields for Type/Name/Description and click the ‘+' button to apply the matching stereotype for the block as shown in Figure 7. In this example the Type is ‘Block’, the Name is 'Block (Design)’. Click OK to finish.
Repeat steps 8 and 9 for the remaining artifact types. The end result should look similar to Figure 8 below.
Now that we have added the SysML and Teamcenter artifact types, we can create mappings between SysML element types and Teamcenter artifact (item) types. To create a mapping, we can start from scratch or we can clone an existing mapping and modify as needed. Underneath the SysML-Teamcenter mapping group, right click the ‘Block - Item (attributes)’ mapping and select Clone Mapping as shown in Figure 9.
In the new window below in Figure 7 below, we simply modify the existing ‘Block - Item’ mapping for each new Teamcenter artifact type shown in Figure 10.
Set the name to Block - Design
Set the description to Block - Teamcenter design with Attributes
Set the Source Artifact Type to the new SysML element (i.e. Block (Design)) you created and set the Target Artifact type to the Teamcenter artifact you created. (i.e. Part, Design)
Set the Structure level to CHILDREN_RECURSIVE and set Include Attributes to Include Attributes
Next, click the Retrieve Available Attribute Definitions button
Click the + button to the left and start mapping the attributes from the left column (SysML) to the attributes on the right column (Teamcenter)
Lastly, click the Save Mapping button when finished at the bottom.
Repeat step 12 above for the other additional mapping(s).
Now that we have defined mappings for the 3 total Teamcenter object types to corresponding SysML element types, we need to specify in the mapping for the parent Teamcenter item type to use the specific mappings for the child item types. Return to the original ‘Block - Item (attributes)’ mapping. In the last field called ‘Related Mappings’, add the newly saved ‘Block - Design’ mapping and ‘Block - Part’ mapping a shown below in Figure 11. Click ‘Save Mapping’ when finished.
In the settings tab of Syndeia, make sure to check the ‘Use mapping’ box as shown below in Figure 12. Then click Apply.
In the Connection Manager tab, drag and drop the parent Teamcenter item on the right side to an empty SysML package on the left. Make sure ‘Model Transform’ connection type is set as shown below in Figure 13. When prompted, select the ‘Block - Item (attributes)’ mapping and click OK.
In Cameo/MagicDraw, you will now see the SysML Blocks generated by Syndeia underneath the package in the containment tree as shown in Figure 14.
Go to the Connection Browser Tab in Syndeia and find the parent block connection created as a result of the model transform, right click, and select Compare Source and Target as shown in Figure 15.
The Comparison Result screen should show a green result that indicates all values are synchronized as shown in Figure 16.
In your Teamcenter Environment, add a child artifact to the original BOM you created. In this example we added an artifact of type ‘Design’ as shown in Figure 17.
Compare the result on the connection again as in step 18 and you will see that Syndeia has recognized the change indicated in red as shown in Figure 18.
Return to the ‘Connection Search' tab and on the Block A connection right click and select 'Sync Target to Source’ as shown in Figure 19.
Compare Source and Target again and the result window should show all green as shown below in Figure 20.
In Cameo/Magicdraw, you will see the child ‘Design 2’ element has been added underneath ‘Block A’ as a result of the sync shown below in Figure 21.
Now click on 'Block A' and update its govClass tag value as shown below in Figure 22.
Compare the parent block connection once again in the Syndeia dashboard. You should see a red line in the result for the change in govClass as shown in Figure 23.
In the Connection Search tab right click on the same connection and select ‘Sync Source to Target’ to propagate the change from SysML to Teamcenter as shown in Figure 24.
Compare the parent block connection once again in the Syndeia dashboard. You should see all green indicating the successful synchronization as shown in Figure 25.
Congrats, you have completed this exercise!