Class BOMUtility

java.lang.Object
com.ptc.windchill.esi.bom.BOMUtility

public final class BOMUtility extends Object
A class that provides convenience APIs for retrieval of BOM info from Windchill back end.

Supported API: true

Extendable: false
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    adjustUsage(com.infoengine.object.factory.Element element, String attName, WTPart part, ESITarget target)
    Update the attribute "Usage" on the input Element using the value defined for the preference "View To BOM Type Mappings".
    static boolean
    compareLineNumbers(LineNumber lineNumber1, LineNumber lineNumber2)
    Compares the values associated with the two input LineNumber objects and returns a boolean value that indicates the outcome of the comparison.

    Supported API: true
    static boolean
    compareLineNumbers(WTPartUsageLink partUsageLink1, WTPartUsageLink partUsageLink2)
    Compares the line numbers on the two input part usage links and returns a boolean value that indicates the outcome of the comparison.
    final boolean
    isBom(WTPart part)
    Returns true if the given part has any children (connected to a WTPartMaster via a WTPartUsageLink) or was ever released by ESI to any target as a BOM.
    final boolean
    isBom(WTPart part, ESITarget target, boolean allViews)
    Returns a true if the input part has any children (connected to a WTPartMaster via a WTPartUsageLink), or was ever released by ESI to the input distribution target as a BOM.
    static void
    populateDelta(Set<Object> links, Map<VersionToObjectLink,Persistable> versionToObjectLinksToParts, int type, Map<VersionToObjectLink,WTPart> delta)
    Populates the Map in delta using the input parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isBom

      public final boolean isBom(WTPart part) throws WTException
      Returns true if the given part has any children (connected to a WTPartMaster via a WTPartUsageLink) or was ever released by ESI to any target as a BOM. Otherwise returns false

      Supported API: true
      Parameters:
      part - The WTPart to be evaluated.
      Returns:
      boolean
      Throws:
      WTException
    • isBom

      public final boolean isBom(WTPart part, ESITarget target, boolean allViews) throws WTException
      Returns a true if the input part has any children (connected to a WTPartMaster via a WTPartUsageLink), or was ever released by ESI to the input distribution target as a BOM. Otherwise returns a false. If a true was passed in for allViews, iterations of the input part in all views are considered while checking if the part was ever published as a BOM; otherwise, only those iterations that reside in the view of the input part iteration are considered.

      Supported API: true
      Parameters:
      part - Input part to be evaluated.
      target - Input distribution target.
      allViews - This is either true or false, according as iterations in all views are to be considered for the database lookup or otherwise respectively.
      Returns:
      A true, if the input part iteration has any children, or was ever released to the input distribution target as a BOM; a false, otherwise.
      Throws:
      WTException
    • adjustUsage

      public static void adjustUsage(com.infoengine.object.factory.Element element, String attName, WTPart part, ESITarget target)
      Update the attribute "Usage" on the input Element using the value defined for the preference "View To BOM Type Mappings". This method does the following: 1. Using the number on the input target, fetch the relevant view using the value defined for the preference "View To Distribution Target Mappings". 2. From this view, fetch the usage using the value defined for the preference "View To BOM Type Mappings". 3. Update the "Usage" attribute on the input Element with the thus fetched usage if appropriate. Log a message stating that the usage on the BOM iteration is ignored, if applicable.

      Supported API: true
      Parameters:
      element - - The element to be updated.
      attName - - The name of the attribute whose value needs to be adjusted.
      part - - Input part for which usage needs to be updated.
      target - - Distribution target for which the input part is being rendered.
    • populateDelta

      public static void populateDelta(Set<Object> links, Map<VersionToObjectLink,Persistable> versionToObjectLinksToParts, int type, Map<VersionToObjectLink,WTPart> delta)
      Populates the Map in delta using the input parameters. The method could typically be invoked once for each type of version to object links fetched from the object comparison framework - i.e., added, deleted, changed or unchanged.

      Supported API: true
      Parameters:
      links - - Set of version to object links (such as a CoProduceMemberLink) obtained from the object comparison framework.
      versionToObjectLinksToParts - - Map holding version to object links as keys, and the other end (role B) objects as values.
      type - - Its value indicates the type of version to object links that are passed in links. For e.g., a value 0 indicates added links, 1 indicates deleted links etc.
      delta - - Output Map to be populated with version to object links and the relevant other end objects. When invoked for deleted links, the Map will hold null values, considering that such links will not figure in versionToObjectLinksToParts.
    • compareLineNumbers

      public static boolean compareLineNumbers(LineNumber lineNumber1, LineNumber lineNumber2)
      Compares the values associated with the two input LineNumber objects and returns a boolean value that indicates the outcome of the comparison.

      Supported API: true
      Parameters:
      lineNumber1 - - First LineNumber object.
      lineNumber2 - - Second LineNumber object.
      Returns:
      A true, if the values associated with the input LineNumber objects are both null, or are equal; a false, otherwise.
    • compareLineNumbers

      public static boolean compareLineNumbers(WTPartUsageLink partUsageLink1, WTPartUsageLink partUsageLink2)
      Compares the line numbers on the two input part usage links and returns a boolean value that indicates the outcome of the comparison. Delegates the work to another method that performs the actual comparison.

      Supported API: true
      Parameters:
      partUsageLink1 - - First part usage link.
      partUsageLink2 - - Second part usage link.
      Returns:
      A true, if line numbers are set on both the input part usage links and are equal, or are not set (i.e., if they are null on both the usage links); a false, otherwise.