Дополнительные возможности > Управление информацией об обслуживании > Customizing Windchill Service Information Manager and Windchill Service Parts > Customizing Service Effectivity Overview > Customizing Service Effectivity
  
Customizing Service Effectivity
Use the following steps to add custom types and attributes of Service Effectivity objects to the list presented in the Type drop down menu in the Manage Applicability dialog box and the Service Effectivity tab of the Edit Filter dialog box.
1. Refer to the configuration file:
codebase/com/ptc/arbortext/windchill/serviceEffectivityFilter
/server/serviceEffectivityConfig.xml
This file defines a list of attributes that corresponds to the list of objects available for selection from the Type menu for Service Effectivity settings and filtering.
* 
Before editing this file, add it to the Safe Area for customizable files to ensure it is not overwritten during a subsequent upgrade/installation.
2. Refer to the Type and Attribute Management utility for the internal names of the attributes you wish to include. You need to create any new custom attributes in this utility. See Working with the Type and Attribute Management Utility for information.
3. In serviceEffectivityConfig.xml, declare the attribute by making a ServiceEffectivtyType entry in the format shown below:
<ServiceEffectivityType name="seLotNumber" renderer="com.ptc.arbortext.windchill.serviceEffectivityFilter.client.ui.
renderers.configTypes.DefaultCustomConfigType" effectivityType="com.ptc.arbortext.windchill.siscore.serviceeff.
ServiceEffectivity"/>
Where, in this example:
name is the internal name of the Service Effectivity attribute. It must match the internal name of the attribute defined in Type and Attribute Management.
renderer is the Java class that determines which fields are displayed for the type and how they are handled in the UI. As a default, this is the generic DefaultCustomConfigType. This renderer generates a simple display — the display name of the attribute and a Value text field.
You can create a custom renderer to implement ServiceEffectivityConfigType and declare it under this attribute.
The renderer also determines how the custom attributes are passed to the filter within the JSON object.
Refer to Creating a Custom Service Effectivity Configuration Panel for information on creating custom data entry fields for attributes.
effectivityType is the internal name of the Service Effectivity type (object) under which the custom attribute was created. This can be a sub-type of ServiceEffectivity. It must match the internal name of the type defined in Type and Attribute Management.
4. Again in serviceEffectivityConfig.xml, create an entry for the attribute in the context of the object type of the root node of the structure, for example WTPart. This entry is required to display the attribute in the Type dropdown for the relevant object.
Make a csvalid entry for the relevant ServiceEffectivityInstance element in the format shown below:
<csvalid serviceeffectivitytype="seLotNumber"/>
The following is an example of a complete ServiceEffectivityInstance entry for WTPart:
<ServiceEffectivityInstance objectType="wt.part.WTPart,wt.part.WTPartMaster,wt.part.alternaterep.WTPartAlternateRep"
objectMaster="wt.part.WTPartMaster">
<csvalid serviceeffectivitytype="serialNumber"/>
<csvalid serviceeffectivitytype="date"/>
<csvalid serviceeffectivitytype="seLotNumber"/>
</ServiceEffectivityInstance>
Where serialNumber and date are the default entries for the file, and seLotNumber is your custom attribute.
* 
The order of the csvalid entries in this file determines the order of the types in the drop down menus.
5. Save the changes to serviceEffectivityConfig.xml according to the conventions described in Setting Up a Directory Structure for Managing Customized Files and Text Tailoring.
To use custom attributes effectively when filtering on service effectivity, create a custom filter delegate to handle the comparison between the filter object and the Service Effectivity objects. Refer to Creating a Custom Filter Delegate for further information.
Creating a Custom Filter Delegate for Custom Service Effectivity Attributes
Windchill provides a delegate for handling service effectivity attributes when filtering (ignore the line break):
com.ptc.arbortext.windchill.siscore.serviceeff.filterDelegates.
DefaultServiceEffectivityDelegate
You can override this delegate to provide a custom one, using a service property in Windchill:
1. Create an XCONF file that contains the appropriate new value for the property:
com.ptc.arbortext.windchill.siscore.serviceeff.filterDelegates.
DefaultServiceEffectivityDelegate
The following XML document is an XCONF command to handle service effectivity objects when filtering:
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE Configuration
SYSTEM "xconf.dtd">
<Configuration targetFile="codebase/typedservices.properties">

<Service context="default" name="com.ptc.arbortext.windchill.siscore.serviceeff.ServiceEffectivityFilterFactory">
<Option requestor="WCTYPE|com.ptc.arbortext.windchill.siscore.serviceeff.ServiceEffectivity"
serviceClass="com.ptc.arbortext.windchill.siscore.serviceeff.filterDelegates.DefaultServiceEffectivityDelegate"/>
</Service>

<Service context="default" name="wt.filter.NavigationFilterDelegate2">
<Option cardinality="singleton" requestor="null"
serviceClass="com.ptc.arbortext.windchill.siscore.serviceeff.filterDelegates.DefaultServiceEffectivityDelegate"
selector="com.ptc.arbortext.windchill.siscore.serviceeff.ServiceEffectivityFilter"/>
</Service>
</Configuration>
Change the DefaultServiceEffectivityDelegate reference under the serviceClass attribute to reflect the new custom delegate.
For further information on using the xconfmanager utility, see Using the xconfmanager Utility.
2. Use the xconfmanager utility to update Windchill services properties. The following command registers the new file and its contents:
xconfmanager -i codebase/custom/myServiceXconfFile.properties.xconf -p