Class ESIBOMComponentRenderer

All Implemented Interfaces:
ESIRenderer
Direct Known Subclasses:
ESIResourceUsageLinkRenderer

public class ESIBOMComponentRenderer extends ESIBOMSubordinateRenderer
This class renders the output of components (i.e. <BOMComponent></BOMComponent> ) in ESI DataResponse.

Supported API: true

Extendable: true
  • 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

      protected void buildGroups() throws ESIRendererException
      Builds the renderer output. For each Collection element in the deltaParts array, iterates the Collection and:
      1. Obtains the list of associated ESITargets.
      2. If alternate item groups are required, obtains the appropriate alternate item group from the alternate item group manager.
      3. Maps the PartUsageInfo object that is contained in the Collection.
      4. Calls adjustObjectID().
      5. Calls adjustTargets().
      6. Calls adjustElement().
      7. Adds the part to the renderedParts collection by calling ESIBOMSubordinateRenderer.addRenderedPart(WTPart).
      The property "com.ptc.windchill.esi.bom.adjustBOMComponents" must be set to true in esi.properties, if the changed and unchanged BOM components are to be adjusted using a custom extension of the API compareUsageLinks(). See the Javadoc for compareUsageLinks() for more information.

      Supported API: true
      Specified by:
      buildGroups in class BasicESIRenderer
      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 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, Map<WTPartUsageLink,Set<WTPartUsageLink>> currToPrevUsageLinks, Collection<ESITargetAssociation> targetAssociations, ESIEffectivityHandler effHandler, boolean lineNumbers, Map<RawMaterialLink,WTPart>[] rawMaterialColArray, 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.
      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

      protected Persistable getRootToFetchOptionSetInfo(WTPart part)
      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

      protected Persistable getContextToFetchOptionSetInfo(WTPart part)
      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