xxx13

Exercise 6-6: Model an Enumerated Type
Objectives
● Model an enumerated type attribute.
● Use enumCustomize to edit the possible values.
Scenario
Customization for a customer requires a modeled attribute (ProductModel) that has possible values restricted to the product model numbers that are being sold. In this exercise, you will be
modeling this attribute using the “enumerated type” design pattern.
Step 1. For all steps in this exercise, refer to an existing pattern as reference.
a. One such example is wt.epm.EPMDocSubType.
Step 2. Add the wt.fc.EnumeratedType class to the com.customer.doc diagram.
There are two classes named EnumeratedType — make sure to use one from the wt.fc package.
a. After adding wt.fc.EnumeratedType, right-click on EnumeratedType. Clear the selection for both Options > Show All Attributes and Options > Show All Operations. This will clean up the diagram; the focus of the model is the custom modeling, not the OOTB classes. The
same action could be performed against WTDocument in this diagram.
Step 3. Create a new class named ProductModel. Although it is a class, it represents an attribute for the CustomerOrder.
Step 4. Create a generalization between ProductModel and EnumeratedType.
Step 5. Create a Unidirectional Aggregation from the attribute class (ProductModel) to the class it describes (CustomerOrder).
Step 6. Set the properties of the unidirectional association.
a. Refer to an existing pattern.
b. Open the properties of the unidirectional aggregation in the existing pattern by double-clicking on that link.
c. Open the properties of the custom unidirectional aggregation in the existing pattern by double-clicking on that link.
d. Navigate through each tab of the OOTB example aggregation and the custom aggregation,making the properties similar. Note that there is some text which is context-specific
(represents the class name or the attribute name) these values should be appropriate for the custom class and custom attribute.
1. The aggregation between ProductModel and CustomerOrder can have role names for each end of the aggregation. Role names are capitalized similar to attribute names — “likeThis”. That explains why the class ProductModel has a role name “productModel” — it is not a typo.
2. The role name could actually be anything which logically explains the relationship between a ProductModel and a CustomerOrder.
Step 7. Implement the change.
a. Save the sub unit.
b. Drop the existing custom tables in the database using the existing SQL.
c. System generate.
d. Recompile.
e. Execute newly generated SQL.
Step 8. Add additional values to ProductModel.
a. Since no default values were specified in the model, there was no default rbInfo file created.enumCustomize can’t be used until there is an existing compiled resource bundle file.
b. Create WT_HOME/src/com/customer/ProductModelRB.rbInfo with the following text:
Example:
ResourceInfo.class=wt.tools.resource.EnumResourceInfo
ResourceInfo.customizable=true
ResourceInfo.deprecated=false
ResourceInfo.replacement=false
MODEL100A.value=Model 110 A
c. From a Windchill shell, execute ResourceBuild com.customer.doc.ProductModelRB.
d. Now that a value exists, useenumCustomize.
e. There will be 3 values in all: Model 100 A, Model 200 A and Model 300 A.
f. Where are the changes resulting from enumCustomize stored?
Step 9. Restart Tomcat and the Method Server.
Step 10. Test.
Take a few minutes to answer the following questions and then review them with your instructor.
1. Question: What happens if Java source code is not compiled after a system generation?
2. Question: Which methods need to be fully implemented by the developer after system generation?
3. Question: What is the easiest way to require user entry for a modeled attribute?
4. Question: True or False: when a method is added to a Persistable class, the database tables should be rebuilt?
5. Question: What is the purpose of “preserve=yes” blocks in Java source code?
Summary
After completing this module, you should be able to:
• Perform tasks in the Engineer Component element of the Application Solution Development module of the System RVP work stream.
• Create a new package structure in Rational Rose.
• Extend a Windchill class.
• Model new attributes in Rational Rose.
• Model enumerated types.
• Implement a modeled customization in Windchill.

你可能感兴趣的:(sql,tomcat,C++,c,SQL Server)