Customization Points
Extendable classes
If classes used by the Windchill ESI renderers described in the Publishing Parts section of this document are extended, the extensions must be defined in certain Windchill ESI preferences or in the ESI service properties file as may be appropriate.
Following are classes that are typically defined in Windchill ESI preferences:
◦ WTPart
Preference name: Part Class
Default value: wt.part.WTPart
◦ WTPartMaster
Preference name: Part Master Class
Default value: wt.part.WTPartMaster
◦ WTPartAlternateLink
Preference name: Part Alternate Link Class
Default value: wt.part.WTPartAlternateLink
The following renderer class is typically defined in the ESI service properties file:
◦ ESIWTPartRenderer
Service Property name: com.ptc.windchill.esi.rnd.ESIRenderer
Default values of attributes of the <Option> element:
cardinality="duplicate"
requestor="wt.part.WTPart"
serviceClass="com.ptc.windchill.esi.esipart.ESIWTPartRenderer"
The following classes are defined in the file as well, to account for the associated control characteristics, model items and quality links:
◦ ESIControlCharacteristicRenderer
Service Property name: com.ptc.windchill.esi.rnd.ESIRenderer
Default values of attributes of the <Option> element:
cardinality="duplicate"
requestor="java.lang.Object"
selector="CONTROLCHARACTERISTIC"
serviceClass="com.ptc.windchill.esi.mpml.pmi.ESIControlCharacteristicRe nderer"
◦ ESIQualityLinkRenderer
Service Property name: com.ptc.windchill.esi.rnd.ESIRenderer
Default values of attributes of the <Option> element:
cardinality="duplicate"
requestor="java.lang.Object"
selector="QUALITYLINK"
serviceClass="com.ptc.windchill.esi.mpml.pmi.ESIQualityLinkRenderer"
All of the above classes are designed to permit extensions by customizers.
Configurable Options
Windchill ESI preferences control several configurable options for Windchill ESI part renderer support. The options are:
◦ Defines the name of the Info*Engine task to invoke when obtaining part information from the Windchill Adapter.
Preference name: Query Part Task
Default value: com/ptc/windchill/esi/QueryPart.xml
◦ Defines the name of the Info*Engine task to invoke when obtaining part alternate information from the Windchill Adapter.
Preference name: Query Alternates Task
Default value: com/ptc/windchill/esi/QueryObject.xml
◦ Defines the value for the releaseClass attribute of a ReleaseActivity that identifies a part (as opposed to a BOM).
Preference name: Release Class for Part
Default value: com.ptc.windchill.esi.Part
◦ Defines the life cycle state values in the form of a comma-separated list. Publication of a part is triggered when its life cycle state changes to any of the values specified for the preference. This happens only if the preference Launch ESI Workflow Automatically is set to Yes and the part is not associated with an implemented Change Notice.
Preference name: Configuration Specification State
Default value: RELEASED
|
The Send To Distribution Target option may be used for triggering the publication of a part, regardless of its lifecycle state.
|
◦ Specifies whether or not to publish ERP Material information for a part. If set to Yes, ESI services will fetch revision information, soft attributes and associated documents (if any) from the relevant ERP Material object and send them with the ESI response. If set to No, no such information will be sent with the ESI response.
Preference name: Publish ERP Material Information
Default value: No
◦ Specifies whether or not to publish plant specific attributes for a part. If set to Yes, plant specific attributes for a part will be sent with the ESI response. If set to No, no plant specific attributes will be sent.
Preference name: Publish Plant Specific Attributes
Default value: No
There are a few configurable attributes on the distribution target that impact the contents of the ESI response message when publishing a part.
Refer to the section Attributes Pertaining to a Part under the topic Distribution Target Attributes in the Windchill Help Center for more details.
|
With both the attributes Publish Alternates When Publishing a Part and Publish Control Characteristics when Publishing a Part set, control characteristics associated to part and alternate part (and the corresponding model items and quality links) are sent along with the ESI response.
|
Configure Part rendering to render Enterprise Data object in a separate element in ESI Response.
Steps to configure:
2. Out of the box code has two maps added. For example - EnterpriseData object types viz. ‘Common Enterprise Data’ and ‘View Specific Enterprise Data’ as ESICommonEnterpriseData and ESIPlantSpecificEnterpriseData. User can create map object for the types as required similar to other objects.
<!-- ESI Common Enterprise Data Mapping -->
<esi:Map id="ESICommonEnterpriseDataEx1">
<esi:attributeMapping sourceAttribute="obid">ObjectID</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="xxxx" defaultValue="com.ptc.windchill.esi.CommonEnterpriseData">Class</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="versionInfo.identifier.versionId">Version</esi:attrib uteMapping>
<esi:attributeMapping sourceAttribute="iterationInfo.identifier.iterationId">Iteration</esi: attributeMapping>
<esi:attributeMapping sourceAttribute="PreviousVersion">PreviousVersion</esi:attributeMappin g>
<esi:attributeMapping sourceAttribute="MaterialGroup">MaterialGroup</esi:attributeMapping>
</esi:Map>
<!-- ESI Plant Specific Enterprise Data Mapping -->
<esi:Map id="ESIPlantSpecificEnterpriseDataEx1">
<esi:attributeMapping sourceAttribute="obid">ObjectID</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="xxxx" defaultValue="com.ptc.windchill.esi.PlantSpecificEnterpriseData">Class
</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="view">View</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="StorageLocation">StorageLocation</esi:attributeMappin g>
</esi:Map>
3. Modify MapInformation object to specify different ‘elementMetaName’ for example ‘CommonData’ and ‘ViewSpecificData’. Default meta information file has this value set to ‘Part’. As this is specified as ‘Part’, default logic willmerge this object with WTPart object attributes rendered in ‘Part’ element . When ‘elementMetaName’ is specified with a value other than ‘Part’ it will start rendering a new element with the name specified as ‘CommonData’ and ‘ViewSpecificData’ respectively.
<!-- ESI Enterprise Data Mapping Information -->
<esi:MapInformation id="ESICommonEnterpriseDataInfoEx01">
<esi:typedef>com.ptc.windchill.enterprise.data.EnterpriseData|com.ptc.windchi ll.enterprise.data.enterpriseData.CommonEnterpriseData</esi:typedef>
<esi:elementMetaName>CommonData</esi:elementMetaName>
<esi:keyAttribute>ObjectID</esi:keyAttribute>
<esi:keyAttribute>Version</esi:keyAttribute>
<esi:mapRef>ESICommonEnterpriseDataEx01</esi:mapRef>
</esi:MapInformation>
<!-- ESI Enterprise Data Mapping Information -->
<esi:MapInformation id="ESIPlantSpecificEnterpriseDataInfoEx01">
<esi:typedef>com.ptc.windchill.enterprise.data.EnterpriseData|com.ptc.windchi ll.enterprise.data.enterpriseData.PlantSpecificEnterpriseData</esi:typedef>
<esi:elementMetaName>ViewSpecificData</esi:elementMetaName>
<esi:keyAttribute>ObjectID</esi:keyAttribute>
<esi:keyAttribute>Version</esi:keyAttribute>
<esi:mapRef>ESIPlantSpecificEnterpriseDataEx01</esi:mapRef>
</esi:MapInformation>
4. Specify this new modified meta information file for new or existing target by using ‘Create/Edit Distribution Target’ UI as required.
5. When Enterprise Data object is rendered as a separate object, associated objects like WTDocument/ EPMDocuments their links will also be rendered to refer to data from these new elements. Otherwise by default documents links for EnterpriseData will be rendered to describe association with the part to which EnterpriseData is associated.
Configure Part rendering to render Plant Functional data object in a separate element in ESI Response.
Steps to configure:
1. Update ESI ResponseMetaInfo.xml for rendering PlantFunctionalData object separately.
2. Out of the box code has one map added. For example - PlantFunctionalData object types viz. ‘Plant Functional Data’ as ESIPlantFunctionalData.If a new attribute is added on Plant Functional Data object, we need to add that soft type as element in ESIPlantFunctionalData map and add
<esi:isEnterpriseDataMergeWithElement>false</esi:isEnterpriseDataMergeWi thElement> in ESIPartInfo.
Alternatively, you can create map object for the types as required similar to other objects.
<!-- ESI Plant Specific Enterprise Data Mapping -->
<esi:Map id="ESIPlantFuncationalDataEx1">
<esi:attributeMapping sourceAttribute="obid">ObjectID</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="xxxx" defaultValue="com.ptc.windchill.esi.PlantFunctionalData">Class</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="name">Name</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="number">Number</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="description">Description</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="versionInfo.identifier.versionId">Version</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="iterationInfo.identifier.iterationId">Iteration</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="PreviousVersion">PreviousVersion</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="view">View</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="alternate1">SupplyChain</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="alternate2">Location</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="category">Category</esi:attributeMapping>
<esi:attributeMapping sourceAttribute="vsedObjID">AssociatedObjectID</esi:attributeMapping>
</esi:Map>
Modify MapInformation object to specify different ‘elementMetaName’, for example ‘PlantFuncData’. Default meta information file has this value set to ‘Part’. As this is specified as ‘Part’, default logic merges this object with WTPart object attributes rendered in ‘Part’ element . When ‘elementMetaName’ is specified with a value other than ‘Part’, it starts rendering a new element with the name specified as ‘PlantFuncData’.
<!-- ESI Plant Functional Data Mapping Information -->
<esi:MapInformation id=" ESIPlantFuncationalDataEx1">
<esi:typedef>com.ptc.windchill.enterprise.data.PlantFunctionalData</esi:typedef>
<esi:elementMetaName>PlantFuncData</esi:elementMetaName>
<esi:keyAttribute>ObjectID</esi:keyAttribute>
<esi:keyAttribute>Version</esi:keyAttribute>
<esi:mapRef>ESIPlantFuncationalDataEx1</esi:mapRef>
</esi:MapInformation>
Specify this new modified meta information file for new or existing target by using Create/Edit Distribution Target UI as required.
Customization of Plant Functional Data Object attributes in ESI Response (When PFD attributes are merged with Part)
If a new attribute is added on Plant Functional Data object, we need to do the following to render it as an element in <Part>:
Extend ESIWTPartRenderer and override adjustPFDElement() API.
The following XML document serves as an input to the xconfmanager command to activate the new part renderer class:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configuration SYSTEM "xconf.dtd"> <Configuration targetFile="codebase/service.properties"> <!-- The ESIRenderer entries for use by com.windchill.esi.rnd.ESIRendererFactory -->
<Service context="default" name="com.ptc.windchill.esi.rnd.ESIRenderer">
<Option cardinality="duplicate" requestor="wt.part.WTPart" serviceClass="com.ptc.windchill.esi.esipart.CustomPFDRenderer "/> </Service> </Configuration>
The file is located in
<Windchill>/codebase/com/ptc/windchill/esi/examples/Example2.service.prop erties.xconf
The following command propagates the changes specified in the file to the file
<Windchill>/codebase/service.properties:
xconfmanager –i codebase/com/ptc/windchill/esi/examples/Example2.service.properties.xconf –p
Modify XSLT (EnterpriseData.xsl) to render PFD attributes as attributes of description element in ESI Response.