Class ESISubstituteRenderer

All Implemented Interfaces:
ESIRenderer

public class ESISubstituteRenderer extends ESIBOMSubordinateRenderer
This class renders the output of substitute (i.e. <Substitute></Substitute>) in ESI DataResponse.

Supported API: true

Extendable: true
  • Method Details

    • buildGroups

      protected void buildGroups() throws ESIRendererException, Exception
      Produces the renderer's output. Obtains an array of Maps of delta parts from the base class. Processes each Map. For each entry in the Map:
      1. Obtains the substitute additions, deletions and commons.
      2. Maps the output.
      3. If alternate item groups are required, obtains the appropriate alternate item group from the alternate item group manager.
      4. Calls adjustObjectID().
      5. Calls adjustTargets().
      6. Calls adjustElement().
      7. Calls addRenderedPart().
      Note: If a substitute part master cannot be resolved to an iteration, the corresponding substitute link is not rendered. Also, the API attempts to fetch previously published part usage links regardless of whether release history was created for those links (which is the case at 11.2 and beyond) or not.

      Supported API: true
      Specified by:
      buildGroups in class BasicESIRenderer
      Throws:
      Exception
      ESIRendererException
    • adjustElement

      protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element elem, String group, PartUsageInfo pui, WTPartMaster sub, Collection targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      elem - - Info*Engine Element to be updated.
      group - - Logical name of the group to which the Element will be added.
      pui - - Part usage link being processed.
      sub - - Part Master Instance of Substitute part
      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, WTPartUsageLink pui, WTPartMaster sub, Collection targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      elem - - Info*Engine Element to be updated.
      group - - Logical name of the group to which the Element will be added.
      pui - - Part usage link being processed.
      sub - - Part Master Instance of Substitute part
      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, ESIBOMRenderer callerObj) throws ESIRendererException
      Initializes this renderer instance appropriately. It sets isAlternateItemGroupActive besides other attributes.

      Supported API: true
      Overrides:
      setData in class ESIBOMSubordinateRenderer
      Parameters:
      root - WTPart instance that represents the top level assembly.
      part - WTPart instance that represents the assembly for which to process the substitutes.
      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 substitutes.
      lineNumbers - Specifies whether or not line numbers associated with components are to be processed.
      callerObj - ESIBOMRenderer instance that was used for rendering the BOM whose substitutes are being processed by this renderer.
      Throws:
      ESIRendererException
    • setData

      public void setData(WTPart rootPart, WTPart part, Map<WTPartUsageLink,WTPart>[] colArray, Collection<ESITargetAssociation> targets, boolean lineNumbers, ESIBOMRenderer callerObj, boolean delta, Map<WTPartUsageLink,Collection<ESIQueryTargetAssociation>> partUsagesToQueryTargetAssocs) throws ESIRendererException
      Initializes this renderer instance appropriately. It sets isAlternateItemGroupActive besides other attributes.

      Supported API: true
      Parameters:
      rootPart - WTPart instance that represents the top level assembly.
      part - WTPart instance that represents the assembly for which to process the substitutes.
      colArray - 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.
      lineNumbers - Specifies whether or not line numbers associated with components are to be processed.
      callerObj - ESIBOMRenderer instance that was used for rendering the BOM whose substitutes are being processed by this renderer.
      delta - Boolean flag value to indicate if delta is to calculated for the assembly or not.
      partUsagesToQueryTargetAssocs - Collection of WTPartUsageLink and its respective ESIQueryTargetAssociation objects.
      targetAssociations - Collection of ESITargetAssociations for the BOM header for which to process the substitutes.
      Throws:
      ESIRendererException