Extend Windchill ESI Java Code
Background
Windchill ESI services features are implemented using Info*Engine tasks and java classes. Details about these tasks and classes can be found in the Windchill ESI Services Modules section of this document. These services can be extended using the Windchill Information Modeler, which is described in the Windchill Customizer’s Guide.
Several key features of the Windchill services can also be quickly customized without using the Windchill Information Modeler. The following customization mechanisms are available:
VDB builder
The Windchill ESI response is an XML document, generated by the toXML API of Info*Engine from the contents of an Info*Engine Virtual Database (VDB). See the Info*Engine User's Guide for more information about the Info*Engine VDB. Windchill ESI services provide a set of classes that structure the VDB so that the ESI response output XML is formatted correctly. Details about the VDB builder (including those pertaining to its customization) are located in the VDB Builder section of this document.
Multiple renderers
Renderers are objects that process Windchill objects and convert those objects into Info*Engine Element objects that are managed and formatted by the Windchill ESI VDB builder (See the VDB Builder section of this document). Windchill ESI services provide the following renderers:
Renderer Class
Objects Rendered
ESIRenderer
N/A – this is an interface implemented by class BasicESIRenderer, described below.
BasicESIRenderer
N/A - this serves as an abstract base class for all of the renderer classes listed below.
ESIAlternateUnitOfMeasureRenderer
AlternateUnitOfMeasure (which holds the alternate unit of measure information for an AlternateUnitAssignable object such as a part master, a process plan master etc.)
ESIWTChangeOrder2Renderer
WTChangeOrder2 and all of the changeable objects
ESIECNHeaderRenderer
WTChangeOrder2
ESIBOMRenderer
Windchill product structure
ESIBOMHeaderRenderer
Windchill part/resource that is representative of the given BOM assembly
ESIBOMSubordinateRenderer
N/A – this serves as an abstract base class for classes ESIBOMComponentRenderer, ESISubstituteRenderer and ESIReferenceDesignatorRenderer.
ESIBOMComponentRenderer
PartUsageInfo object (which describes a WTPartUsageLink object)
ESISubstituteRenderer
PartUsageInfo object (which describes a WTPartSubstituteLink object)
ESIReferenceDesignatorRenderer
PartUsageInfo object (which describes a UsesOccurrence object)
ESIWTPartRenderer
WTPart and any associated WTPartMaster and WTPartAlternateLink objects EnterpriseData object associated with WTPart object
ESIAbstractDocumentsRenderer
N/A – this serves as an abstract base class for class ESIEPMDocumentRenderer.
ESIDocumentsRenderer
PartDocInfo object (which describes WTDocument, EPMDocument, WTPartReferenceLink, WTPartDescribeLink, BuildHistory, ERPMaterialDocumentDescribeLink, ERPMaterialDocumentReferenceLink and ERPMaterialEPMDocumentDescribeLink objects).
* 
This class renders WTDocuments and CAD documents that are associated to RevisionControlled objects, and also standalone WTDocuments.
ESIEPMDocumentRenderer
CAD document and its dependents (viz., CAD documents that are associated to the primary document via a member or a reference association).
* 
This class renders CAD document structures and standalone CAD documents.
ESIMadeFromObjectRenderer
A Made From Object such as a Made From Set or a Co-Produce.
ESIPromotionRequestRenderer
PromotionNotice and all the associated Promotable objects. However, only the Promotable objects are sent with the ESI response by default; if the PromotionNotice is to be sent as well, it would call for customizing the ESI response meta information file.
ESIProcessPlanRenderer
MPMProcessPlan and all the associated objects such as sequences, operations, standard procedures, documents, BOMs etc.
ESIProcessPlanHeaderRenderer
The MPMProcessPlan object and its attributes.
ESIStandardProcedureLinkRenderer
MPMStandardProcedureLink (which links a process plan/sequence/operation to its standard procedure).
ESIPartToProcessPlanLinkRenderer
MPMPartToProcessPlanLink (which links a process plan to its part).
ESIWorkInstructionRenderer
N/A – renders work instructions associated with an MPMOperationHolder such as an MPMOperation.
ESISequenceRenderer
MPMSequence and its associated objects such as documents and standard procedures.
ESISequenceUsageLinkRenderer
MPMSequenceUsageLink (which links a process plan to its sequence).
ESIOperationRenderer
MPMOperation and all the associated objects such as sub-operations, standard procedures, BOM allocated parts, operated on parts, work instructions, documents, resources etc.
ESIOperationUsageLinkRenderer
MPMOperationUsageLink (which links a process plan/sequence/operation to its operation/sub-operation).
ESIOperationToPartLinkRenderer
MPMOperationToPartLink (which links an operation to its BOM allocated part).
ESIOperatedOnPartLinkRenderer
MPMOperationToOperatedPartLink (which links an operation to the "operated on" part).
ESIOperationConsumableResourceRenderer
MPMOperationToConsumableLink (which links an operation to a consumable resource, such as a tooling or a process material).
ESIOperationWorkCenterRenderer
MPMOperationToWorkCenterLink (which links an operation to a work center).
ESIResourceRenderer
N/A – this serves as an entry point for the processing of various types of resources (such as tooling, process materials and skills); it instantiates a resource renderer of the appropriate type and delegates the processing of the given resource to that instance.
ESIToolingRenderer
MPMTooling and all the associated documents.
ESIProcessMaterialRenderer
MPMProcessMaterial and all the associated documents.
ESISkillRenderer
MPMSkill and all the associated documents.
ESIControlCharacteristicRenderer
MPMControlCharacteristic and the associated ModelItem.
ESIQualityLinkRenderer
MPMPartQualityLink (which links a part to a control characteristic), MPMProcessQualityLink (which links a process plan to a control characteristic) and MPMOperationQualityLink (which links an operation to a control characteristic master).
ESIResourceUsageLinkRenderer
WTPartUsageLink that is part of the resource structure and associates MPMResource to MPMResourceMaster or WTPartMaster.
ESIProcessPlanLocalizationLinkRenderer
MPMProcessPlanLocalizationLink that associates MPMProcessPlan to line type of a work center.
ESIPlantLocalizationLinkRenderer
MPMPlantLocalizationLink that associates work center to an operation.
Renderers that are listed below in this table are available when ESI Options and Variants is installed
OptionSetRenderer
OptionSet and associations such as OptionSetMemberLinks, OptionSetChoiceRuleMasterLink/OptionSetChoiceRuleLink and OptionSet to Option virtual link.
AssignedOptionSetLinkRenderer
OptionSet to Part association
ChoiceRuleRenderer
ChoiceRule renderer.
OptionRenderer
Option and Choice object renderer.
ExpressionRenderer
Basic and Advanced expressions that are Dependent or Independent are rendered by this renderer.
RuleMemberLinkRenderer
ExpressionMemberLink or SourceChoice are rendered by this renderer.
RuleMemberActionLinkRenderer
RuleMemberActionLink or ChoiceMappableChoiceLink renderer.
As mentioned in the above table, each of the renderer classes provided by ESI services extends the abstract class BasicESIRenderer, which in turn implements the interface ESIRenderer. The class BasicESIRenderer provides concrete implementations of a number of methods besides public void render(VdbBuilder), the only method provided by the ESIRenderer interface.
Publishing Process PlansThe following table lists the names of classes that provide concrete implementations for the various getXXX() APIs of ESI services:
Java Class Name
API Name
ESIWTChangeOrder2Renderer
getECN
ESIBOMRenderer
getBOM
ESIWTPartRenderer
getPart
ESIDocumentsRenderer
getDocument
ESIEPMDocumentRenderer
getDocument, getEPMDocument
ESIProcessPlanRenderer
getProcessPlan
ESIResourceRenderer
getResource
ESIPromotionRequestRenderer
getPromotionRequest
OptionSetRenderer
getOptionSet
See the Windchill Enterprise Systems Integration Open Application Programming Interface Guide and also the sections Publishing CNs,, Publishing BOMs,, Publishing Parts,, Publishing Documents,, Publishing Process Plans,, Publishing Resources, and Publishing Promotion Requests for details about the getXXX() APIs.
Creating object specific renderer implementations
Windchill ESI services provide a number of renderer classes that handle GetXXX requests initiated by a user. Each of these classes extends the abstract class BasicESIRenderer, which in turn implements the interface ESIRenderer by providing a concrete implementation for themethod public void render(VdbBuilder). This method calls setBuilder(), validate() and buildGroups() – while BasicESIRenderer provides a concrete implementation for setBuilder(), it merely provides abstract versions of validate() and buildGroups(). The corresponding concrete versions are provided by the object specific renderer implementations. For example, class ESIWTPartRenderer implements these methods in ways that are appropriate for the rendering of WTPart objects.
ESI services provide a default renderer implementation for each of the object types mentioned in the Objects Rendered column of the table Windchill ESI Renderers. All of these implementations allow for extensions by customizers.
Obtaining the renderer implementation from a factory
ESI services make use of an ESIRendererFactory instance to fetch the renderer implementation that is appropriate for a given GetXXX request. The class ESIRendererFactory provides overloaded versions of the method getRenderer(), which returns an ESIRenderer instance of an appropriate type, based on input parameters passed to it. The factory class is not intended to be customized, but only to facilitate customization.
Following are the available methods in class ESIRendererFactory:
getRenderer(anObject : Persistable) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object in the argument anObject. It does this by fetching the UFID of the passed object and then invoking getRenderer(ufid : String).
getRenderer(ufid : String) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object, whose UFID is passed in the argument ufid. This method may be used for object types where the <Option> element does not carry a selector attribute in the xconf file that lists ESI service properties.
getRenderer(ufid : String, selector : String) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object whose UFID is passed in the argument ufid and for the given selector. This method may be used for object types where the
<Option> element carries a selector attribute in the xconf file that lists ESI service properties.
getRenderer(anObject : Persistable, selector : String) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object in the argument anObject and for the given selector.
getRenderer(requestor : Class, selector : String) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object, whose Class is passed in the argument requestor, and for the passed selector. Some of the overloaded forms described above invoke this method to get their job done. A call to this method will always result in a newly created renderer instance being returned.
getInstance() : ESIRendererFactory
Returns the value in the class variable manager, if it exists. Otherwise, creates a new instance of ESIRendererFactory using a protected argumentless constructor, initializes manager and returns it to the caller.
getRenderer(ufid : String, useCache : boolean) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object, whose UFID is passed in the argument ufid. This method may be used for object types where the <Option> element does not carry a selector attribute in the xconf file that lists ESI service properties. The method either fetches the renderer instance from cache or creates a new instance, according as useCache is true or false respectively.
getRenderer(ufid : String, selector : String, useCache : boolean) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object whose UFID is passed in the argument ufid and for the given selector. This method may be used for object types where the <Option> element carries a selector attribute in the xconf file that lists ESI service properties. The method either fetches the renderer instance from cache or creates a new instance, according as useCache is true or false respectively.
getRenderer(requestor : Class, selector : String, useCache : boolean) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object, whose Class is passed in the argument requestor, and for the passed selector. The method getRenderer(requestor : Class, selector : String) gets its job done by invoking this method, passing in a false for the argument useCache, with the result that a newly created renderer instance is always returned to the caller.
getRenderer(anObject : Persistable, selector : String, useCache : boolean) : ESIRenderer
Fetches an ESIRenderer instance of the required type for the object in the argument anObject and for the given selector. The method either fetches the renderer instance from cache or creates a new instance, according as useCache is true or false respectively.
* 
Each of the default renderer implementation classes produces Info*Engine Element objects. These Element objects are passed to the VDB builder. Most default renderers provide a method called adjustElement() - where this method is available, it is always called by the default renderer immediately before passing the element to the builder. The default implementation of the method is to do nothing.
The Windchill ESI mapper facility provides access only to the getter methods of the objects that are mapped. The mapper does not provide complex logic capabilities. The adjustElement() method provides a simple way to add or modify the renderer output in cases where changes to the response meta information file are insufficient to achieve the desired result.
When invoking a getRenderer() API that takes in the useCache argument, it is recommended that a false be passed for useCache, since passing a true would result in a renderer instance being fetched from cache, which may already be in use by a concurrently executing transaction.
As someone customizing Windchill Enterprise Systems Integration, you may choose to extend the default renderer implementation class or write a new implementation class. The extension (or the new implementation) can be activated by making a certain Windchill ESI service property point to the extension (or the new) class, and by making the responseMetaInfoPath attribute on the relevant ESITarget object point to an appropriately modified version of the ESI response meta information file, containing entries for additional attributes that may be rendered by the extension (or the new) class. See the Modify the ESI Response Meta Information File section of this document for information about changing the contents of the response meta information file. See the Windchill ESI Services Modules section of this document for a description of the property to change when extending a default renderer implementation or providing a new renderer implementation class.
Providing a hook
Each of the default renderer implementation classes produces Info*Engine Element objects. These Element objects are passed to the VDB builder. Most default renderers provide a method called adjustElement() - where this method is available, it is always called by the default renderer immediately before passing the element to the builder. The default implementation of the method is to do nothing.
The Windchill ESI mapper facility provides access only to the getter methods of the objects that are mapped. The mapper does not provide complex logic capabilities. The adjustElement() method provides a simple way to add or modify the renderer output in cases where changes to the response meta information file are insufficient to achieve the desired result.
Was this helpful?