Analyzing Data › Defining Entity Types, Relationships, and Attributes › Defining Entity Type Attributes › Attribute Default Value or Algorithm
Attribute Default Value or Algorithm
For each attribute that contain permitted values (basic or designed, text, or number), you specify either a default value or default algorithm, but not both.
- The default value is a single value for the attribute that must be among its permitted values.
- When creating an entity, CA Gen automatically assigns default values to all attributes for which default values were specified, unless another value is explicitly set. For example, imagine that customer Status has a default value of "Cash Only." In such a case, whenever a customer is created, Status is automatically set to "Cash Only" unless it is explicitly overridden.
- The default algorithm is a calculation whose result is used to initialize an attribute value.
- When the entity that contains the attribute is created, the attribute is assigned its value that is based on the result of the default algorithm. For example, suppose that CUSTOMER Numbers are assigned sequentially. When a new CUSTOMER is created, its Number attribute receives the value of the previously created CUSTOMER Number plus one. The rule that states this is a default algorithm. For example: (CUSTOMER Number = previous CUSTOMER Number + 1).
- The specification of default algorithms requires the use of the Action Diagramming Tool. Details on building a default algorithm are, therefore, covered in the chapter Analyzing Interactions.
Copyright © 2014 CA.
All rights reserved.
|
|