Personnalisation avancée > Business Logic Customization > Product Family Management Customizations > Handling Initial Modeled or Soft Attribute Values for New Variant Specifications
Handling Initial Modeled or Soft Attribute Values for New Variant Specifications
Handling Initial Modeled or Soft Attribute Values for New Variant Specifications
You can plug in special business processing of the Variant Specification definition when it is being copied from an existing Variant Specification. The common soft attributes are copied from the source Variant Specification to the new Variant Specification. Any remaining unset soft attributes that have a defined "default" are initialized according to the Type definition. Using the customization hook, you can extend the default delegate to set additional attributes. This allows you to control what and how the data contained in the Variant Specification is copied to a new instance of a Variant Specification. Create a custom delegate to process the copy of the Variant Specification from the Paste as Copy table.
Solution Elements
Element
Type
Description
com.ptc.windchill.enterprise.productfamily.delegates.PasteVariantSpecDelegateIfc
Interface
Generalizable interface for copying a variant specification.
com.ptc.windchill.enterprise.productfamily.delegates.PasteVariantSpecDelegate
Delegate class
Supports the Copy/Paste of a Variant Specification.
com.ptc.core.components.forms.DefaultObjectFormProcessorDelegate
Delegate class
Supports the Copy/Paste of a default object.
WncProductFamilyManagement-service.properties.xconf
Default change service properties
Out-of-the-box property file that registers the PasteVariantSpecDelegate.
Customization Steps
1. Create a new Java class (delegate) that extends the PasteVariantSpecDelegate.
2. In order for the new delegate to be called, register the delegate. For example, if you want to override the PasteVariantSpecDelegate, declare the following rule:
<Service context="default" name=
"com.ptc.windchill.enterprise.productfamily.delegates.PasteVariantSpecDelegateIfc">
<OptionserviceClass=
"com.ptc.windchill.enterprise.productfamily.delegates.YourCustomPasteVariantSpecDelegate"
selector="null"
requestor="null"
cardinality="duplicate"/>
</Service>
3. To register the above service, run the following command in a Windchill shell:
xconfmanager –Fp
4. Restart the Method Server.
Example: Copy Delegate
Est-ce que cela a été utile ?