Class BOMHelper


  • public final class BOMHelper
    extends java.lang.Object
    Helper class containing static method useful when dealing with product's bills of materials. These methods are also available as services (see BOMServices).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String createProductionRunsForShipment​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static int getMaxDepth​(java.lang.String productId, java.lang.String bomType, java.util.Date inDate, Delegator delegator)
      Returns the product's low level code (llc) i.e.
      static GenericValue searchDuplicatedAncestor​(java.lang.String productId, java.lang.String productIdKey, java.lang.String bomType, java.util.Date inDate, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin)
      Returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present, null otherwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • getMaxDepth

        public static int getMaxDepth​(java.lang.String productId,
                                      java.lang.String bomType,
                                      java.util.Date inDate,
                                      Delegator delegator)
                               throws GenericEntityException
        Returns the product's low level code (llc) i.e. the maximum depth in which the productId can be found in any of the bills of materials of bomType type.
        Parameters:
        productId - The product id
        bomType - The bill of materials type (e.g. manufacturing, engineering,...)
        delegator - Validity date (if null, today is used).
        inDate - The delegator
        Returns:
        The low level code for the productId. (0 = root, 1 = first level, etc...)
        Throws:
        GenericEntityException - If a db problem occurs.
      • searchDuplicatedAncestor

        public static GenericValue searchDuplicatedAncestor​(java.lang.String productId,
                                                            java.lang.String productIdKey,
                                                            java.lang.String bomType,
                                                            java.util.Date inDate,
                                                            Delegator delegator,
                                                            LocalDispatcher dispatcher,
                                                            GenericValue userLogin)
                                                     throws GenericEntityException
        Returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present, null otherwise. Useful to avoid loops when adding new assocs (components) to a bill of materials.
        Parameters:
        productId - The product to which we want to add a new child.
        productIdKey - The new component we want to add to the existing bom.
        bomType - The bill of materials type (e.g. manufacturing, engineering).
        inDate - Validity date (if null, today is used).
        delegator - The delegator used
        Returns:
        the ProductAssoc generic value for a duplicate productIdKey ancestor if present, null otherwise.
        Throws:
        GenericEntityException - If a db problem occurs
      • createProductionRunsForShipment

        public static java.lang.String createProductionRunsForShipment​(javax.servlet.http.HttpServletRequest request,
                                                                       javax.servlet.http.HttpServletResponse response)