Resource Target

When the target is a resource, the value of the resource is incremented. One of the most common uses of provides and consume constraints is to manage resources.

Resources keep track of configuration variables that increase or decrease as the user makes selections. For example, suppose you are creating a customizable product rule for configuring desktop computers. Your product includes several types of chassis. Each chassis has a different number of slots for expansion cards. The product also includes 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 you must keep track of the number of slots available in a chassis during the configuration process to verify that the computer is configured correctly.

Using provide and consume constraints to increment a resource is the way to handle this:

  • First define a resource to keep track of slots, for example Slots Available.

  • Then define an attribute called Slots on the chassis class. Create a enumerated values of data type integer. Create one record for each chassis type. The value for each record is an integer equal to the number of slots in the chassis type. This creates a menu of choices for setting the number of slots in a chassis. Assign the list of values to the Slots attribute definition.

  • Display the attributes for each chassis and set the value of the Slots attribute and save the record. This sets the number of slots in the chassis and prevents it from being changed by the user or the Siebel Product Configurator engine.

  • Add the chassis class to a relationship, Chassis.

  • Define an attribute called Slots Required on the expansion card class. Use a range of values domain and set the data type to Integer. Enter: ==1 as the validation expression. Enter 1 as the default value.

  • Display the attributes for each expansion card and save the Slots Required record. This sets the number of slots required at 1 and prevents it from being changed by the user or the Siebel Product Configurator engine.

  • Add the expansion card class to a relationship, Expansion Card.

  • Write the following constraint: Chassis provides Chassis Slots to Slots Available.

  • Write the following constraint: Expansion Card consumes Expansion Card Attribute = Slots Required from Slots Available.

  • Write constraints as needed to determine what happens if Slots Available is 0 or if it becomes negative.

When the user selects a chassis, the provide constraint increases the Slots Available resource by the number of slots in the chassis. Each time the user selects an expansion card, the consume constraint decreases the Slots Available resource by one. Thus, the Slots Available resource maintains a record of how many slots are available in the chassis during the configuration session.

If a resource has the same name in two different customizable products, the Siebel Product Configurator engines treats them as the same resource. You can take advantage of this in cases where one product with components is contained within another. For example, product with components CP2 is contained within product with components CP1. You define resource R1 in both products. Constraints in either product with components that contribute to R1, affect the value of R1 in both products. Use this behavior to allow a parent product with components to contribute to a resource in a child product with components.