16Configuration Resources
Configuration Resources
This chapter explains how to create resources, which are variables that keep track of important configuration information when the user configures a customizable product. These variables can be used in configuration constraints.
For information about constraints, see Configuration Constraints.
This chapter includes the following topics:
About Configuration Resources
Resources keep track of configuration variables that increase or decrease as the user configures a product. For example, suppose you are defining a desktop computer customizable product. The product includes several types of chassis. Each chassis has a different number of slots for expansion cards. Allowable configurations also include several types of expansion cards, such as disk controllers, and graphics cards.
You do not know in advance which chassis the customer will select or how many expansion cards. However, you do know that you must keep track of the number of slots during the configuration process to make sure that the customer configures the computer correctly.
Resources are the way you do this:
First define a resource to keep track of slots, for example slots-resource.
For the class containing all the chassis, define an attribute, slots-provided, that tells how many slots are in the chassis. Typically, this attribute will have a single-value domain and the data type will be Number.
For each class containing expansion cards, define an attribute, slots-required, that tells how many slots each card needs, usually 1. Typically, this attribute will have a single-value domain, and the data type will be Number.
Finally, write provide and consume constraint to manage the slots-resource.
When the user selects a chassis, a provide constraint adds the amount of the chassis' slots-provided attribute to the slots-resource. When the user selects an expansion card, a consume constraint subtracts the amount of the card's slots-required attribute from the slots-resource. In this fashion, the slots-resource keeps track of available slots in the computer chassis.
Resources definitions have the data type Number. This means that they can only have numeric, integer, or floating point values.
Creating Configuration Resources
When you create a resource, it is added to a dialog box. You can copy this resource definition to other customizable products and edit the definition as needed. In turn, the edited definition is added to the dialog box. When you remove a resource from a customizable product, it is removed from the dialog box.
All resources have the data type number. They can have only numeric, integer, or floating point values.
To create a resource
Navigate to the Administration - Product screen, then the Product Definitions or Product Classes view.
Select and lock the desired customizable product or product class.
Navigate to the Resources view for the Work Space version.
In the Resource Administration list, add a new record and complete the necessary fields, described in the following table.
Field | Comments |
---|---|
Name |
Enter the resource name. Use this name to refer to the resource in configuration constraints. The resource name does not display to the user. Since a resource name can be used by more than one product, avoid making the name product-specific. |
Description |
Enter a description of the resource. This description does not display to the user. |
Managing Resources Using Configuration Constraints
The most common way to manage a resource is to write provide and consume constraints that add or subtract the value of an attribute from the resource. For example, you could write a configuration constraint that contributes the number of slots in a chassis to a resource called slots available. You could also write configuration constraints that consume slots from the resource when the user picks an expansion card.
By convention, the value of a resource must exactly equal the sum of all the contributors to the resource. Constraints that consume or reduce the amount of a resource are negative contributors. The value of a resource is a computed value and cannot be directly set by a configuration constraint.
For example you define resource R. You then write a configuration constraint that sets the value of R to 5:
R ==5
When you validate the customizable product, this constraint will be rejected by the application because it sets the value of R at an arbitrary value rather than allowing the value of R to be computed as the sum of all its contributors.
About Managing Configuration Resources
You can manage resources in the following ways:
Editing Configurator Resource Definitions
You must select and lock a customizable product before editing a resource definition. If you change the name of a resource, the name is not changed in configuration constraints where it appears.
Editing the name of a resource changes its name in the Pick Resource dialog box.
Deleting Configuration Resources
You delete a resource by deleting the resource record from the Resource Administration list. Deleting a resource from a customizable product deletes it from the Pick Resource dialog box.
You must select and lock a customizable product before deleting a resource.