Package com.ptc.windchill.esi.bom
Class ESIBOMComponentRenderer
java.lang.Object
com.ptc.windchill.esi.rnd.BasicESIRenderer
com.ptc.windchill.esi.bom.ESIBOMSubordinateRenderer
com.ptc.windchill.esi.bom.ESIBOMComponentRenderer
- All Implemented Interfaces:
ESIRenderer
- Direct Known Subclasses:
ESIResourceUsageLinkRenderer
This class renders the output of components (i.e. <BOMComponent></BOMComponent> ) in ESI DataResponse.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumADDED_AND_DELETED - Send the BOM component in a pair of added and deleted elements.
UNCHANGED - Send the BOM component in the unchanged element.
NONE - No adjustment action is needed; send as is. -
Field Summary
Fields inherited from class com.ptc.windchill.esi.bom.ESIBOMSubordinateRenderer
currToPrevUsageLinks, delParts, part, partUsageLinksWithSubstitutes, partUsagesToTargetAssocsMap, renderedParts, rmDelParts, root, targetAssociationsFields inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
adapterName, authentication, currentTarget, DELIMITER, objectTypeDefs, OPTIONSVARIANTS_HELPER_CLASS_STRING, SEPARATOR, taskHelper, XML_META_NAME -
Method Summary
Modifier and TypeMethodDescriptionprotected com.infoengine.object.factory.ElementadjustDeletedCPLinkElement(String groupName, com.infoengine.object.factory.Element element, ESIReleasedObjectAttributes attrs, ESIReleasedObjectSnapshot snapshot, Object object, Collection<ESITarget> targets) Allows subclasses to fix the contents of the input Element before it is added to the output group(s).protected com.infoengine.object.factory.ElementadjustDeletedRawMaterialLinkElement(String groupName, com.infoengine.object.factory.Element element, ESIReleasedObjectAttributes attrs, ESIReleasedObjectSnapshot snapshot, Object object, Collection<ESITarget> targets) Allows subclasses to fix the contents of the input Element before it is added to the output group(s).protected com.infoengine.object.factory.ElementadjustElement(com.infoengine.object.factory.Element elem, String group, RawMaterialLink rmLink, Collection<ESITarget> targets) Allows subclasses to fix the contents of the input Element before it is added to the output group(s).protected com.infoengine.object.factory.ElementadjustElement(com.infoengine.object.factory.Element elem, String group, WTPartUsageLink usageLink, Collection<ESITarget> targets) Allows subclasses to fix the contents of the input Element before it is added to the output group(s).protected com.infoengine.object.factory.ElementadjustElement(com.infoengine.object.factory.Element elem, String group, VersionToObjectLink versionToObjectLink, Collection<ESITarget> targets) Allows subclasses to fix the contents of the input Element before it is added to the output group(s).protected com.infoengine.object.factory.ElementadjustMadeFromLinkElementsInBOMComponent(com.infoengine.object.factory.Element elem, WTPart madeFromSet, WTPart header, RMAlternateLink link) Allows subclasses to fix the contents of the input Element before it is added to the output group(s).protected voidBuilds the renderer output.protected ESIBOMComponentRenderer.AdjustActionscompareUsageLinks(WTPartUsageLink partUsageLink, Set<WTPartUsageLink> prevUsageLinks) Returns AdjustActions.NONE, meaning no action is to be taken.protected PersistableReturns the context object to be used for fetching the option set information.protected PersistableReturns the root object to be used for fetching the option set information.voidsetData(WTPart root, WTPart part, Collection<PartUsageInfo>[] deltaParts, Collection<ESITargetAssociation> targetAssociations, boolean lineNumbers, String auth, String wcAdapter) Initializes this renderer instance appropriately.voidsetData(WTPart root, WTPart part, Collection<PartUsageInfo>[] deltaParts, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, String auth, String wcAdapter) Initializes this renderer instance appropriately.voidsetData(WTPart root, WTPart part, Map<WTPartUsageLink, WTPart>[] deltaParts, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, String auth, String wcAdapter) Initializes this renderer instance appropriately.voidsetData(WTPart root, WTPart part, Map<WTPartUsageLink, WTPart>[] deltaParts, Map<WTPartUsageLink, Set<WTPartUsageLink>> currToPrevUsageLinks, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, Map<RawMaterialLink, WTPart>[] rawMaterialColArray, String auth, String wcAdapter) Initializes this renderer instance appropriately.Methods inherited from class com.ptc.windchill.esi.bom.ESIBOMSubordinateRenderer
addRenderedPart, addRenderedPart, addRenderedPart, addRenderedPart, addRenderedParts, areComponentQuantitiesRequired, areLineNumbersEnforced, getAigManager, getCaller, getCurrToPrevUsageLinks, getDelParts, getDeltaParts, getPart, getPartUsageLinksWithSubstitutes, getRenderedParts, getRenderedParts, getRmDelParts, getRoot, getTargetAssociations, getTargetAssocsForPartUsageLink, isDefaultFilter, isLineNumberEnabled, setData, setData, setData, setData, setData, setPartUsageLinksWithSubstitutes, setPartUsagesToTargetAssocsMap, setRoot, shouldConsolidateComponentQuantity, validateMethods inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
addAtt, adjustConfigurableAndCollapsibleAtts, adjustDateEffCxt, adjustDateEffectivities, adjustEffectivities, adjustLotNumberEffCxt, adjustLotNumberEffectivities, adjustObjectID, adjustSerialNumberEffCxt, adjustSerialNumberEffectivities, adjustTargets, buildUfidString, evaluateBussinessRule, fetchLatestEffectivities, formatDateEffectivityElement, getAdapterName, getAssignedVariantSpec, getAssignedVariantSpec, getAUMRenderer, getAuth, getBuilder, getEffectivityElementMap, getEffectivityHandler, getEffectivityTargetAttributes, getElements, getERPMaterialAttributeList, getERPMaterialAttributeList, getERPMaterialTargetAttributes, getFormatedDate, getGroupInfo, getGroupInfo, getGroupInfo, getMap, getMap, getMapInfo, getMapInfo, getMapInfo, getNavigationFilter, getObjectTypeDefs, getPlantSpecificAttributeList, getPlantSpecificAttributeList, getPlantSpecificTargetAttributes, getPreviousObject, getPreviousPublishedEffectivity, getTargetsFromAssns, getTargetUtility, getTransactionUtility, getUnwantedAttributes, getVersionRefObjectRefMap, getWCAttributeList, getWCAttributeList, initEffectivityHandler, initializeElementForGroup, invokeQueryTask, invokeQueryTask, invokeQueryTask, invokeQueryTaskForObjects, isExpressionToBePublished, isGroupAvailable, isPublishAssocOptionSetFlagEnabled, mapDateEffectivities, mapEffectivities, mapEffectivityAttributes, mapEffectivityElement, mapEffectivityParentElement, mapElement, mapElement, mapElement, mapElementWithEffectivityAttrs, mapLotNumberEffectivities, mapObject, mapObject, mapSerialNumberEffectivities, mergeElements, overrideAttrValue, populateDateEffectivityInfo, populateEffectivityInfo, processBussinessRulesWithAnd, processBussinessRuleValidationResultSet, processNoMatchingVersionFound, removeAttributesNotRequired, removeUnwantedEffectivityAttributes, render, renderAssociatedSkinnyVariantSpec, renderAssociatedVariantSpec, renderAssocOptionSetLinks, renderAssocSkinnyVariantSpec, renderAssocVariantSpec, renderATONavigationFilter, renderChoiceRules, renderEffectivities, renderEffectivities, renderExpressions, renderOptionSets, renderRoleBObjectOfModuleVariantLink, setAttrValue, setAttrValue, setAttrValues, setBuilder, setCurrentTarget, setCurrentTarget, setCurrentTargetFromTgtAssocs, setEffectivityHandler, setObjectTypeDefs, setObjectTypeDefs, setObjectTypeDefsFromObj, setStartEndEffAttr, setTransactionUtility, shallPublishAssocOptionSet, shouldRenderEffectivityElementInPartElement, shouldUseOldEffectivityBehaviour, storeCurrentAndItsPreviousObject, storeCurrentAndItsPreviousObject
-
Method Details
-
compareUsageLinks
protected ESIBOMComponentRenderer.AdjustActions compareUsageLinks(WTPartUsageLink partUsageLink, Set<WTPartUsageLink> prevUsageLinks) Returns AdjustActions.NONE, meaning no action is to be taken. However, a custom extension of this renderer can provide an overriding version of the method that can return any other constant (ADDED_AND_DELETED or UNCHANGED), depending on the outcome of a comparison between the currently and previously published part usage links as appropriate.
Note: Returning ADDED_AND_DELETED would cause the currently published part usage link to be sent as an added link, and the previously published part usage link as a deleted link in the ESI response. Returning UNCHANGED currently does not result in any action.
Supported API: true- Parameters:
partUsageLink- - Part usage link that is currently being published.prevUsageLinks- - Set of the corresponding previously published usage links.- Returns:
- AdjustActions.NONE.
-
buildGroups
Builds the renderer output. For each Collection element in the deltaParts array, iterates the Collection and:- Obtains the list of associated ESITargets.
- If alternate item groups are required, obtains the appropriate alternate item group from the alternate item group manager.
- Maps the PartUsageInfo object that is contained in the Collection.
- Calls adjustObjectID().
- Calls adjustTargets().
- Calls adjustElement().
- Adds the part to the renderedParts collection by calling
ESIBOMSubordinateRenderer.addRenderedPart(WTPart).
Supported API: true- Specified by:
buildGroupsin classBasicESIRenderer- Throws:
ESIRendererException
-
adjustElement
protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element elem, String group, WTPartUsageLink usageLink, Collection<ESITarget> targets) throws ESIRendererException Allows subclasses to fix the contents of the input Element before it is added to the output group(s). Default behavior is to return the input Element itself.
Supported API: true- Parameters:
elem- - Info*Engine Element to be updated.group- - Logical name of the group to which the Element will be added.usageLink- - Part usage link being processed.targets- - Collection of ESITarget objects.- Returns:
- Element - Updated Element.
- Throws:
ESIRendererException
-
adjustElement
protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element elem, String group, VersionToObjectLink versionToObjectLink, Collection<ESITarget> targets) throws ESIRendererException Allows subclasses to fix the contents of the input Element before it is added to the output group(s). Default behavior is to return the input Element itself.
Supported API: true- Parameters:
elem- - Info*Engine Element to be updated.group- - Logical name of the group to which the Element will be added.versionToObjectLink- - version to object link being processed.targets- - Collection of ESITarget objects.- Returns:
- Element - Updated Element.
- Throws:
ESIRendererException
-
adjustElement
protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element elem, String group, RawMaterialLink rmLink, Collection<ESITarget> targets) throws ESIRendererException Allows subclasses to fix the contents of the input Element before it is added to the output group(s). Default behavior is to return the input Element itself.
Supported API: true- Parameters:
elem- - Info*Engine Element to be updated.group- - Logical name of the group to which the Element will be added.rmLink- - Raw material link being processed.targets- - Collection of ESITarget objects.- Returns:
- Element - Updated Element.
- Throws:
ESIRendererException
-
setData
public void setData(WTPart root, WTPart part, Collection<PartUsageInfo>[] deltaParts, Collection<ESITargetAssociation> targetAssociations, boolean lineNumbers, String auth, String wcAdapter) throws WTException Initializes this renderer instance appropriately.
Supported API: true- Parameters:
root- WTPart instance that represents the top level assembly.part- WTPart instance that represents the assembly for which to process the components.deltaParts- Array of elements, each of which is a collection of PartUsageInfo instances; each such instance represents either an added, deleted, changed or an unchanged component in the BOM being processed.targetAssociations- Collection of ESITargetAssociations for the BOM header for which to process the components.lineNumbers- Specifies whether or not line numbers associated with components are to be processed.auth- I*E authentication information to use when executing a query task.wcAdapter- Windchill adapter instance name to use when executing a webject.- Throws:
WTException
-
setData
public void setData(WTPart root, WTPart part, Collection<PartUsageInfo>[] deltaParts, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, String auth, String wcAdapter) throws WTException Initializes this renderer instance appropriately. This overloaded version of setData() differs from the other version in that it sets effectivityHandler to the value passed in by the caller; this is achieved through a call to setEffectivityHandler(). This is typically useful in a situation where the ESIBOMRenderer instance may populate the fields latestEffs and lastExportedEffs of the ESIEffectivityHandler instance and this (ESIBOMComponentRenderer) instance needs access to those fields.
Supported API: true- Parameters:
root- WTPart instance that represents the top level assembly.part- WTPart instance that represents the assembly for which to process the components.deltaParts- Array of elements, each of which is a collection of PartUsageInfo instances; each such instance represents either an added, deleted, changed or an unchanged component in the BOM being processed.targetAssociations- Collection of ESITargetAssociations for the BOM header for which to process the components.effHandler- EffectivityHandler instance that was used for processing effectivity specifications on the BOM header.lineNumbers- Specifies whether or not line numbers associated with components are to be processed.auth- I*E authentication information to use when executing a query task.wcAdapter- Windchill adapter instance name to use when executing a webject.- Throws:
WTException
-
setData
public void setData(WTPart root, WTPart part, Map<WTPartUsageLink, WTPart>[] deltaParts, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, String auth, String wcAdapter) throws WTExceptionInitializes this renderer instance appropriately. This overloaded version of setData() differs from the other version in that it sets effectivityHandler to the value passed in by the caller; this is achieved through a call to setEffectivityHandler(). This is typically useful in a situation where the ESIBOMRenderer instance may populate the fields latestEffs and lastExportedEffs of the ESIEffectivityHandler instance and this (ESIBOMComponentRenderer) instance needs access to those fields.
Supported API: true- Parameters:
root- WTPart instance that represents the top level assembly.part- WTPart instance that represents the assembly for which to process the components.deltaParts- Array of elements, each of which is a collection of PartUsageInfo instances; each such instance represents either an added, deleted, changed or an unchanged component in the BOM being processed.targetAssociations- Collection of ESITargetAssociations for the BOM header for which to process the components.effHandler- EffectivityHandler instance that was used for processing effectivity specifications on the BOM header.lineNumbers- Specifies whether or not line numbers associated with components are to be processed.auth- I*E authentication information to use when executing a query task.wcAdapter- Windchill adapter instance name to use when executing a webject.- Throws:
WTException
-
setData
public void setData(WTPart root, WTPart part, Map<WTPartUsageLink, WTPart>[] deltaParts, Map<WTPartUsageLink, throws WTExceptionSet<WTPartUsageLink>> currToPrevUsageLinks, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, Map<RawMaterialLink, WTPart>[] rawMaterialColArray, String auth, String wcAdapter) Initializes this renderer instance appropriately. This overloaded version of setData() differs from the other version in that it sets effectivityHandler to the value passed in by the caller; this is achieved through a call to setEffectivityHandler(). This is typically useful in a situation where the ESIBOMRenderer instance may populate the fields latestEffs and lastExportedEffs of the ESIEffectivityHandler instance and this (ESIBOMComponentRenderer) instance needs access to those fields.
Supported API: true- Parameters:
root- WTPart instance that represents the top level assembly.part- WTPart instance that represents the assembly for which to process the components.deltaParts- Array of elements, each of which is a collection of PartUsageInfo instances; each such instance represents either an added, deleted, changed or an unchanged component in the BOM being processed.currToPrevUsageLinks-targetAssociations- Collection of ESITargetAssociations for the BOM header for which to process the components.effHandler- EffectivityHandler instance that was used for processing effectivity specifications on the BOM header.lineNumbers- Specifies whether or not line numbers associated with components are to be processed.rawMaterialColArray-auth- I*E authentication information to use when executing a query task.wcAdapter- Windchill adapter instance name to use when executing a webject.- Throws:
WTException
-
getRootToFetchOptionSetInfo
Returns the root object to be used for fetching the option set information. This method is intended to be overridden by a customizer if they want to use a different root other than the input part. It returns the input part by default. The renderer "com.ptc.windchill.esi.ov.ChoiceMappableChoiceLinkRenderer" uses this object to find the appropriate option set for the current part being rendered. Check the java doc of this renderer for more information.
Supported API: true- Parameters:
part- - WTPart- Returns:
-
getContextToFetchOptionSetInfo
Returns the context object to be used for fetching the option set information. This method is intended to be overridden by a customizer if they want to use a different context other than the input part. It returns the input part by default. The renderer "com.ptc.windchill.esi.ov.ChoiceMappableChoiceLinkRenderer" uses this object to render appropriate context information in the response. Check the java doc of this renderer for more information.
Supported API: true- Parameters:
part- - WTPart- Returns:
-
adjustMadeFromLinkElementsInBOMComponent
protected com.infoengine.object.factory.Element adjustMadeFromLinkElementsInBOMComponent(com.infoengine.object.factory.Element elem, WTPart madeFromSet, WTPart header, RMAlternateLink link) Allows subclasses to fix the contents of the input Element before it is added to the output group(s). Default behavior is to return the input Element itself.
Supported API: true- Parameters:
elem- - Info*Engine Element to be updated.madeFromSet- - Made from set object.header- - Parent part of Made from set object.- Returns:
- Element - Updated Element.
-
adjustDeletedRawMaterialLinkElement
protected com.infoengine.object.factory.Element adjustDeletedRawMaterialLinkElement(String groupName, com.infoengine.object.factory.Element element, ESIReleasedObjectAttributes attrs, ESIReleasedObjectSnapshot snapshot, Object object, Collection<ESITarget> targets) throws ESIRendererException Allows subclasses to fix the contents of the input Element before it is added to the output group(s). Default behavior is to return the input Element itself.
Supported API: true- Parameters:
groupName- - Logical name of the group to which the Element will be added.element- - Info*Engine Element to be updated.attrs- - Attributes object being processed.snapshot- - Snapshot object being processed.object- - Object being processed.targets- - Collection of ESITarget objects.- Returns:
- Element - Updated Element.
- Throws:
ESIRendererException
-
adjustDeletedCPLinkElement
protected com.infoengine.object.factory.Element adjustDeletedCPLinkElement(String groupName, com.infoengine.object.factory.Element element, ESIReleasedObjectAttributes attrs, ESIReleasedObjectSnapshot snapshot, Object object, Collection<ESITarget> targets) throws ESIRendererException Allows subclasses to fix the contents of the input Element before it is added to the output group(s). Default behavior is to return the input Element itself.
Supported API: true- Parameters:
groupName- - Logical name of the group to which the Element will be added.element- - Info*Engine Element to be updated.attrs- - ESIReleasedObjectAttributes object holding attributes information on the version to object link being processed.snapshot- - ESIReleasedObjectSnapshot object holding useful information on the version to object link being processed.object- - Object being processed.targets- - Collection of ESITarget objects.- Returns:
- Element - Updated I*E Element.
- Throws:
ESIRendererException
-