Class ESIBOMRenderer

All Implemented Interfaces:
ESIRenderer

public class ESIBOMRenderer extends ESIAbstractStructureRenderer
This class renders the output of BOM which includes header, components, substitutes and reference designators.

Supported API: true

Extendable: true
  • Method Details

    • isBomPart

      protected boolean isBomPart()
      Gets the value of the attribute: bomPart; Should a part be created for the BOM?

      Supported API: true
      Returns:
      boolean
    • isComponentParts

      protected boolean isComponentParts()
      Gets the value of the attribute: componentParts; Should parts be created for the BOM's components?

      Supported API: true
      Returns:
      boolean
    • isAlternates

      protected boolean isAlternates()
      Gets the value of the attribute: alternates; If parts = true, should the output also include the alternates of the parts?

      Supported API: true
      Returns:
      boolean
    • isSubstitutes

      protected boolean isSubstitutes()
      Gets the value of the attribute: substitutes; Are substitutes to be included in the output?

      Supported API: true
      Returns:
      boolean
    • setDocuments

      public void setDocuments(boolean a_Documents) throws WTPropertyVetoException
      Sets the value of the attribute: documents; Are documents to be included in the output?

      Supported API: true
      Parameters:
      a_Documents -
      Throws:
      WTPropertyVetoException
    • getConfigspec

      protected String getConfigspec()
      Gets the value of the attribute: configspec; The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.

      Supported API: true
      Returns:
      String
    • setConfigspec

      public void setConfigspec(String a_Configspec) throws WTPropertyVetoException
      Sets the value of the attribute: configspec; The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.

      Supported API: true
      Parameters:
      a_Configspec -
      Throws:
      WTPropertyVetoException
    • getAuthentication

      protected String getAuthentication()
      Gets the value of the attribute: authentication; Authentication information to use when using the Windchill Adapter for obtaining information.

      Supported API: true
      Returns:
      String
    • getTransactionID

      protected Integer getTransactionID()
      Gets the value of the attribute: transactionID; The number of an ESI transaction.

      Supported API: true
      Returns:
      Integer
    • setData

      @Deprecated public void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID) throws WTException
      Provide the data required to render a BOM.
      Parameters:
      obid - The UFID of the Windchill assembly part to be rendered.
      provideDelta - Should the output contain only items that have changed since the last time an object was released?
      buildBOMPart - Should a part be created for the BOM?
      buildComponentParts - Should parts be created for the BOM's components?
      buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
      buildSubs - Are substitutes to be included in the output?
      buildRefDes - Are reference designators to be included in the output?
      useLineNumbers - Are line numbers to be included in the output?
      multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
      buildDocs - Are documents to be included in the output?
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - Authentication information to use when using the Windchill Adapter for obtaining information.
      wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
      transactionID - The number of an ESI transaction.
      Throws:
      WTException
    • setData

      public void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID, boolean publishProdBOM) throws WTException
      Provide the data required to render a BOM.

      Supported API: true
      Parameters:
      obid - The UFID of the Windchill assembly part to be rendered.
      provideDelta - Should the output contain only items that have changed since the last time an object was released?
      buildBOMPart - Should a part be created for the BOM?
      buildComponentParts - Should parts be created for the BOM's components?
      buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
      buildSubs - Are substitutes to be included in the output?
      buildRefDes - Are reference designators to be included in the output?
      useLineNumbers - Are line numbers to be included in the output?
      multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
      buildDocs - Are documents to be included in the output?
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - Authentication information to use when using the Windchill Adapter for obtaining information.
      wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
      transactionID - The number of an ESI transaction.
      publishProdBOM - Is production BOM needs to be published for target?
      Throws:
      WTException
    • setData

      public void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID, boolean publishProdBOM, boolean publishCoproduce) throws WTException
      Deprecated.
      Use setData(String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, String, boolean, String, String, String, String, WTPart, boolean) instead
      Provide the data required to render a BOM.

      Supported API: true
      Parameters:
      obid - The UFID of the Windchill assembly part to be rendered.
      provideDelta - Should the output contain only items that have changed since the last time an object was released?
      buildBOMPart - Should a part be created for the BOM?
      buildComponentParts - Should parts be created for the BOM's components?
      buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
      buildSubs - Are substitutes to be included in the output?
      buildRefDes - Are reference designators to be included in the output?
      useLineNumbers - Are line numbers to be included in the output?
      multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
      buildDocs - Are documents to be included in the output?
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - Authentication information to use when using the Windchill Adapter for obtaining information.
      wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
      transactionID - The number of an ESI transaction.
      publishProdBOM - Is production BOM needs to be published for target?
      Throws:
      WTException
    • setData

      public void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID, boolean publishProdBOM, WTPart root) throws WTException
      Provide the data required to render a BOM.

      Supported API: true
      Parameters:
      obid - The UFID of the Windchill assembly part to be rendered.
      provideDelta - Should the output contain only items that have changed since the last time an object was released?
      buildBOMPart - Should a part be created for the BOM?
      buildComponentParts - Should parts be created for the BOM's components?
      buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
      buildSubs - Are substitutes to be included in the output?
      buildRefDes - Are reference designators to be included in the output?
      useLineNumbers - Are line numbers to be included in the output?
      multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
      buildDocs - Are documents to be included in the output?
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - Authentication information to use when using the Windchill Adapter for obtaining information.
      wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
      transactionID - The number of an ESI transaction.
      publishProdBOM - Is production BOM needs to be published for target?
      Throws:
      WTException
    • validate

      protected void validate() throws ESIRendererException
      Make sure that obid is not null.

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

      protected void buildGroups() throws ESIRendererException
      Builds the renderer output. Does the following:
      1. Obtains the list of parts to be rendered. Uses the services of a TreeNavigator
      2. For each part obtained:
        • Obtains a list of targets assigned to the part.
        • Finds the last previous released version of the part for each target.
        • For each previous version : current version pair, obtains the difference from the StandardWTPartService. If there is no previous version, the entire part structure is returned.
        • Calls the BOM header renderer.
        • Calls the BOM component renderer.
        • Optionally calls the substitute renderer.
        • Optionally calls the reference designator renderer
        • Calls adjustElement().
      3. If parts are requested, calls com.ptc.windchill.esi.esipart.ESIWTPartRenderer.getPart() to render the parts on the BOM.


      Supported API: true
      Specified by:
      buildGroups in class BasicESIRenderer
      Throws:
      ESIRendererException
      See Also:
      • invalid reference
        ESIWTPartRenderer#getPart(WTPart, Collection, boolean, boolean, String, String, VdbBuilder, ESIBOMRenderer)
    • getBOM

      public void getBOM(WTPart part, boolean delta, boolean bomPart, boolean componentParts, boolean alternates, boolean substitutes, boolean referenceDesignators, boolean lineNumbers, String multiLevel, boolean documents, String configSpec, String auth, String wcAdapter, VdbBuilder builder) throws WTException
      RPC processor when called from the getECN RPC. Validates arguments and creates a VDBBuilder if one hasn't already been provided. Creates a BOM Renderer. Passes control to the renderer. Does not call asVDB() on the renderer because the caller of this method is responsible for doing that.

      Supported API: true
      Parameters:
      part - The assembly part for the top-level BOM.
      delta - If "true", returns only the changes since the last successful export. Default is "true".
      bomPart - Should a part be created for the BOM?
      componentParts - Should parts be created for the BOM's components?
      alternates - If "true", returns alternate part info, default is "false". Only operative if "Parts" = "true".
      substitutes - If "true", returns substitute data
      referenceDesignators - If "true", returns Reference Designator data.
      lineNumbers - If "true", returns line numbers info, no line numbers info otherwise.
      multiLevel - The number of levels of BOM, default is 1.
      documents - If "true", returns associated documents info, default is "false".Only operative if "Parts" = "true".
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - This parameter contains authentication information from I*E.
      wcAdapter - This parameter contains the name of the Windchill adapter.
      builder - The VdbBuilder to use when creating output.
      Throws:
      WTException
    • getPreviousExportedIterationAssociations

      protected Map<PreviousExportedIterationKey,Collection<ESITargetAssociation>> getPreviousExportedIterationAssociations(WTPart part, Collection<ESITargetAssociation> tgtAssociations, boolean delta) throws WTException
      Computes the previous exported iteration for the input target associations. Invokes the API
      invalid reference
      ESITransactionUtility#latestBOMExport(Collection)
      .

      Computing a previous exported iteration is target sensitive because each target is not guaranteed to have the same previously exported iteration. For example, an assembly could be associated with target 1, then exported, then associated with target 2, and exported a second time. In the case of the second export, target 1 has a previous exported iteration, while target 2 does not. Therefore, the output map contains a previous exported iteration mapped to collection of targets.

      Supported API: true

      Parameters:
      part - - BOM header being processed. Could be the top level BOM header or a Sub BOM Header. Currently not used. But this may be useful for customizers.
      tgtAssociations - - Collection of distribution target associations. Typically the target association between the input part and current distribution target being processed.
      delta - - Decides whether or not this API should compute previous exported iterations. If false, previous exported iteration would be null for each target association.
      Returns:
      - a map whose key is a previous Exported Iteration and the value is a collection of distribution target associations.
      Throws:
      WTException
    • newBOMOrgFilter

      public static BOMOrgFilter newBOMOrgFilter() throws ESIRendererException
      Returns an instance of BOMOrgFilter (or an appropriate subclass). Obtains the name of the class from ESIProperties.

      Supported API: true
      Returns:
      BOMOrgFilter
      Throws:
      ESIRendererException
    • getBOM

      public com.infoengine.object.IeCollection getBOM(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter, boolean useECNDTAttrs) throws WTException
      Creates a VdbBuilder instance for the input transaction, renders the input assembly and creates release activities as appropriate for each of the distribution targets in tgts. The settings pertaining to ESI response generation for a given distribution target are fetched from the target itself. Returns the rendered output as an Info*Engine collection to the caller.

      Supported API: true
      Parameters:
      objectID - UFID of the assembly part to be rendered.
      txn - ESITransaction object that represents the delivery of data to the distribution targets in tgts; will be null when the method is invoked for the Preview functionality.
      tgts - Collection of distribution targets that represent a given destination, such as an ERP instance.
      auth - This parameter contains authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      wcAdapter - This parameter contains the name of the Windchill adapter instance.
      useECNDTAttrs - If true, distribution target attributes that figure in the ECN Settings section will be used for the response generation; otherwise, attributes that figure in the BOM Settings section will be used. For example, a true will be passed for this parameter when the method is invoked for the Preview functionality and the preference "Automatically Generate Change Notice" has a value "Yes".
      Returns:
      IeCollection The Info*Engine collection that holds the ESI response.
      Throws:
      WTException - - if any of the invoked methods throws this exception.
    • adjustBOMNodes

      public void adjustBOMNodes(Set<WTPart> bomNodes) throws WTException
      Adjust BOM Header before renderer starts rendering BOM parts. OOTB code checks leaf nodes of BOM that were published as BOM and adds them to BOM header set. Method determines leaf nodes by checking part usages for the leaf nodes returned by the navigator.

      Supported API: true
      Throws:
      WTException
    • getBOM

      public void getBOM(WTPart part, WTPart root, TreeNavigator treeNavigator, String auth, String wcAdapter, VdbBuilder builder) throws WTException
      This API is invoked from AbstractResourceRenderer, to render BOM present in the resource structure when MPMLink is installed.

      Supported API: true
      Parameters:
      part - The assembly part for the top-level BOM.
      treeNavigator - The TreeNavigator instance.
      auth - This parameter contains authentication information from I*E.
      wcAdapter - This parameter contains the name of the Windchill adapter.
      builder - The VdbBuilder to use when creating output.
      header - The parent of input part.
      Throws:
      WTException
    • setData

      public void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID, boolean publishProdBOM, boolean publishCoproduce, WTPart root) throws WTException
      Deprecated.
      Use setData(String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, String, boolean, String, String, String, String, WTPart, boolean) instead
      Provide the data required to render a BOM.

      Supported API: true
      Parameters:
      obid - The UFID of the Windchill assembly part to be rendered.
      provideDelta - Should the output contain only items that have changed since the last time an object was released?
      buildBOMPart - Should a part be created for the BOM?
      buildComponentParts - Should parts be created for the BOM's components?
      buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
      buildSubs - Are substitutes to be included in the output?
      buildRefDes - Are reference designators to be included in the output?
      useLineNumbers - Are line numbers to be included in the output?
      multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
      buildDocs - Are documents to be included in the output?
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - Authentication information to use when using the Windchill Adapter for obtaining information.
      wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
      transactionID - The number of an ESI transaction.
      publishProdBOM - Is production BOM needs to be published for target?
      root - The root part.
      Throws:
      WTException
    • setData

      public void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID, WTPart root, boolean publishProdBOM) throws WTException
      Provide the data required to render a BOM.

      Supported API: true
      Parameters:
      obid - The UFID of the Windchill assembly part to be rendered.
      provideDelta - Should the output contain only items that have changed since the last time an object was released?
      buildBOMPart - Should a part be created for the BOM?
      buildComponentParts - Should parts be created for the BOM's components?
      buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
      buildSubs - Are substitutes to be included in the output?
      buildRefDes - Are reference designators to be included in the output?
      useLineNumbers - Are line numbers to be included in the output?
      multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
      buildDocs - Are documents to be included in the output?
      configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
      auth - Authentication information to use when using the Windchill Adapter for obtaining information.
      wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
      transactionID - The number of an ESI transaction.
      root - The root part.
      publishProdBOM - Is production BOM needs to be published for target?
      Throws:
      WTException