Common Tasks: Working with Types
Overview
You can create, edit, and delete Types using the Type Editor in Workbench. To learn more about modeling and using Types and Objects, it's suggested that you start with the Project Builder tutorial.
Add a Type or Subtype
All Types must be a Subtype of one of the base Types built into the system. All new Types are created as Subtypes of either one of the base Types or a Type previously created by a user. For more detailed information on the base Types please see the Base Type reference section. The most common types you will be working with (and subtyping) are:
- Builders (subtype of Mediator) - Coordinates builds and packaging tools. Populates repository with registered packages.
- Packages - Manages the lifecycle of deployable artifacts registered in release repository. All common package types are available as subtypes.
- Updaters (subtype of Mediator) - Coordinates the end-to-end build and deployment process. Dispatches commands to both Builders and Sites.
- Sites (subtype of Mediator) - Manages groups of Services that form an integrated business application(s)
- Services - Software installation that provides an application process with a runtime state
The diagram belows shows how the building block types interact to form a standard build and deployment lifecycle. In this example, the Updater kicks off the entire process by calling its BuildAndUpdate command (with a tag, buildstamp, or other identifier that the Builders understand). The Builders coordinate the various build and packaging processes and registers the newly created packages with the release repository (a WebDAV-based repository generally located on the ControlTier Server or admin node). The Updater sends a command to the Site automation to modify the management model and to use the new packages to update, configure, and restart the various components that makeup the Site (Sites are user defined but are generally a collection of related Services that makeup an integrated business application in a particular environment).

To create a new Type, navigate to the Type you wish to subtype and select the Add Type button.
Figure: Add Type button on Type Editor screen

Enter details and select options for the new Type. As advanced options you can choose the Types role, abstract or concrete. Abstract means you cannot directly create objects of that Type (but you can create Subtypes). Concrete means you can create objects of that Type. Another advanced option is to allow objects to have non-unique names. The default behavior is to allow only unique names.
Figure: Add Type Dialogue

Setting Constraints and Defaults
You are able to set constraints and defaults that are used when an Object of that Type is created or edited.
This includes:
- Default values - enables users to select values from a drop down list and pre-populate values for new objects.
- Constraints on values - limits the value or types of text users can input
- Constraints on kind of resources that can be associated with Objects of that Type (Assembly and Subtypes of Assembly only) - limits the kind of Objects that can be attached as child resources associated with Objects of that Type
- Default resources for Objects created of that Type (Assembly and Subtypes of Assembly only) -Objects of this type will automatically have these specific child resource associations when created
To edit the Constraints and Defaults for a given Type, first go that Type in the Type Editor. Next, select the appropriate edit link in the properties table. The most common properties for which you will want to set constraints or defaults will be resources (child dependencies), referrers (parent dependencies), or attribute values. The other properties are generally only constrained or set with defaults in special situations.
Figure: To edit a constraint or default value, select the pencil icon next to the Type property you want to edit and follow the resulting dialogue. In this example, Objects of Type HNSite are only allowed to have child dependencies to Objects of Type HNTomcat or HNMysql. The number "1" next to the name HNMysql means that it is a singleton dependency and can only have a dependency on one HNMysql Object.

Removing a Type
To remove (Delete) a type, select the Remove Type icon in the Type Editor. Workbench will ask for confirmation before removing a Type.
Figure: Remove Current Type icon

2. When a Type is deleted its definition is removed from the project but its version history is retained. If the Type is re-created the version history will be re-used. This maintains continuity in the change log.
Locking Types
You can lock the current Type so that further changes to the Type cannot be made until the Type is unlocked. Only the user that created the Type or a user with the administrator role can unlock the Type. There is a confirmation step before the Type is locked or unlocked.
Figure: Button to lock/unlock Type



