Like items, parts are also objects in the database, but it is more useful to think of them as allowed links between items of different types. Parts are "owned" or defined by an item and are, therefore, always created in the context of an owning item type. The relationships are configured as part of the meta model and will guide users in their work. Just as with items, a part is always of a particular part type. This article describes how to create and add a part type to an item type.
Prerequisites
- The owning item type of the part type exists.
- The DefObj ("Defining Object") which is the type that the new part will point to exists.
- Familiar with the SystemWeaver meta model building blocks (e.g., Items, Parts and Attributes)
- Familiar with the SystemWeaver Explorer Interface and common operations
- An installation of the SystemWeaver Explorer client (swExplorer)
- Assignment of the SW Architect role in the server
- An installation of the SystemWeaver Architect client (swArchitect)
To get started, open the swArchitect application and go to the Metadata tab.
- In the Type structure tree to the left, select the item type for which you want to create a new part. The item is considered the "owner" type. Part types are always created on the item type that is owning the relationship.
- All existing part types for the item will display in the Part Types section to the right.
To get started, you will first have to decide which type of part you want to create.
Determining Part Type
Simple Part Type
A simple part type is the most typical part type. Most commonly, it is used to point to another Item and it represents an instance of that item in the context of the item owning the part.
The defining item type can then be used for defining additional semantic properties of the part.
Other uses of the simple part type are to map not items, but other parts or nodes (see Structural Part Type), which are also Referenceables (referenceable means that it has a unique identity and that it can be referred to). In that case, the referenceables are used as references to parts or nodes.
Structural Part Type
A structural part type has the same properties as a Simple Part type, but in addition, the parts created according to a Structural part type will also create or add to a node structure called a node tree:
- In case the item owning the structural part in question is used as a structural part in some other item, than the node structure of that structural part will be extended with an additional node representing the structural part.
- Furthermore, in case the structural part in question has defining item types with structural parts, then nodes according to those parts will be added to any node structure where the item with the structural part is used as a defining type, and so on iteratively.
The purpose of the node structure is to create a unique representation of each part in a specific part structure, for the purpose of making references to such nodes. Due to the computational cost of node structures in terms of storage and data communication, structural parts should only be used when it is necessary to make that kind of reference to them. In some cases it is possible to use either references to items (when a specific item is guaranteed to be used only once in a part structure) or to parts (when no references are made deeper into a part structure).
Note: There is also an option for Associative Part Type, however, this is a legacy construct. |
Defining the Part
Once you have determined the type for the new part, click the corresponding Add Simple Part Type or Add Structural Part Type button or right-click in the Part Types section and make your selection in the context menu. Although the selection implies that you are adding a part type, you are not adding an existing part type (part types cannot be shared between different item types). You are creating a new part type (and adding) it to the selected item type.
The Enter Part Type dialog will display.
Enter the following information:
SID: Enter the SID for the new part type. This is required. Note that, although possible, the SID is not easily changed afterwards. See Change Type SID in the Help.
Name: Enter a name for the new part type. This is required. The part name can easily be changed afterwards.
Multiplicity: Select 'List' if multiple parts of this part type will be allowed for the owning item or 'Single' if only one part of this type will be allowed. This is required.
DefObj: The "Defining Object" is the defining item type. It is the type that the new part type will point to. As mentioned above, the most common way to use the DefObj is to point to an item and this reference is said to represent an instance of that item in the context of the item owning the part. The DefObj entry is required.
RefObj: A "Referenced Object" of a part is optional and is used, in some cases, to reference a second Item, e.g., in order to describe some kind of mapping between two items in the context of the item owning the part. In that case, both the DefObj and the RefObj have similar roles, and none of them (or both of them) define additional specific semantics of the part (i.e., the semantics of the part can be described fully by its part type). RefObjs are never seen in the structure tree view, so a view must be used to create/add them.
Click Save when you have entered all of the information for the new part type. It will display in the Part Types section:
The new part type is immediately available to users via the swExplorer.
You can now create inherited parts for the created item. The Item Type view shows how the item inherits from its parent:
Once the part type information is saved, the part type will display for the selected item type in the Part Types list. Because it is not inherited (inheritance is explained further down in this training), it displays with a white background:
To set the properties for the newly created part type, select it in the Part tree to the left. Just like for item types, you can set the icon for the part type which will display for the item that is used with the part. If you do not assign an icon to a part type, the icon of the DefType item type (the item that the part is pointing to) will be applied instead.
Viewing Parts and Saving Tree View Settings - add links to this.
By default, parts are not displayed in the tree in Explorer. To view a part type, right-click on the owner item, select View, and select the part type.
As an Architect, you can save the modified view setting so that all users viewing the structure can see the now-viewable part type. Right-click on the part and click Save active settings to new view:
The parts to be displayed are saved on the item type that is at the top of the tree. Each time a user opens this item type, the tree will show the part types saved on the opened item type.
When setting up a SystemWeaver installation, it is important to create all necessary view settings for the users.
- Identify what item types users will open as top item
- Set reasonable view settings for all of these types
Tip: Learn more about working with default structure tree views in Configuring Tree View Settings.