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

  • Assignment of the SW Architect role in the database
  • An installation of the SystemWeaver Architect (swArchitect)
  • 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


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. 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.