Class BOMServices


  • public class BOMServices
    extends java.lang.Object
    Bills of Materials' services implementation. These services are useful when dealing with product's bills of materials.
    • Field Summary

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

      Constructors 
      Constructor Description
      BOMServices()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> createShipmentPackages​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> getBOMTree​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      It reads the product's bill of materials, if necessary configures it, and it returns an object (see BOMTree and BOMNode) that represents a configured bill of material tree.
      static java.util.Map<java.lang.String,​java.lang.Object> getManufacturingComponents​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List of BOMNode).
      static java.util.Map<java.lang.String,​java.lang.Object> getMaxDepth​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Returns the product's low level code (llc) i.e.
      static java.util.Map<java.lang.String,​java.lang.Object> getNotAssembledComponents​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> getProductsInPackages​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List of BOMNode).
      static java.util.Map<java.lang.String,​java.lang.Object> initLowLevelCode​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Updates the product's low level code (llc) for all the products in the Product entity.
      static java.util.Map<java.lang.String,​java.lang.Object> searchDuplicatedAncestor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present, null otherwise.
      static java.util.Map<java.lang.String,​java.lang.Object> updateLowLevelCode​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Updates the product's low level code (llc) Given a product id, computes and updates the product's low level code (field billOfMaterialLevel in Product entity).
      • 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
    • Constructor Detail

      • BOMServices

        public BOMServices()
    • Method Detail

      • getMaxDepth

        public static java.util.Map<java.lang.String,​java.lang.Object> getMaxDepth​(DispatchContext dctx,
                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        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. If the bomType input field is not passed then the depth is searched for all the bom types and the lowest depth is returned.
        Parameters:
        dctx - the dispatch context
        context - the context
        Returns:
        returns the product's low level code (llc) i.e. the maximum depth
      • updateLowLevelCode

        public static java.util.Map<java.lang.String,​java.lang.Object> updateLowLevelCode​(DispatchContext dctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Updates the product's low level code (llc) Given a product id, computes and updates the product's low level code (field billOfMaterialLevel in Product entity). It also updates the llc of all the product's descendants. For the llc only the manufacturing bom ("MANUF_COMPONENT") is considered.
        Parameters:
        dctx - the distach context
        context - the context
        Returns:
        the results of the updates the product's low level code
      • initLowLevelCode

        public static java.util.Map<java.lang.String,​java.lang.Object> initLowLevelCode​(DispatchContext dctx,
                                                                                              java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Updates the product's low level code (llc) for all the products in the Product entity. For the llc only the manufacturing bom ("MANUF_COMPONENT") is considered.
        Parameters:
        dctx - the distach context
        context - the context
        Returns:
        the results of the updates the product's low level code
      • searchDuplicatedAncestor

        public static java.util.Map<java.lang.String,​java.lang.Object> searchDuplicatedAncestor​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        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:
        dctx - the distach context
        context - the context
        Returns:
        returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present
      • getBOMTree

        public static java.util.Map<java.lang.String,​java.lang.Object> getBOMTree​(DispatchContext dctx,
                                                                                        java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        It reads the product's bill of materials, if necessary configures it, and it returns an object (see BOMTree and BOMNode) that represents a configured bill of material tree. Useful for tree traversal (breakdown, explosion, implosion).
        Parameters:
        dctx - the distach context
        context - the context
        Returns:
        return the bill of material tree
      • getManufacturingComponents

        public static java.util.Map<java.lang.String,​java.lang.Object> getManufacturingComponents​(DispatchContext dctx,
                                                                                                        java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List of BOMNode).
        Parameters:
        dctx - the distach context
        context - the context
        Returns:
        return the list of manufacturing components
      • getNotAssembledComponents

        public static java.util.Map<java.lang.String,​java.lang.Object> getNotAssembledComponents​(DispatchContext dctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createShipmentPackages

        public static java.util.Map<java.lang.String,​java.lang.Object> createShipmentPackages​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getProductsInPackages

        public static java.util.Map<java.lang.String,​java.lang.Object> getProductsInPackages​(DispatchContext dctx,
                                                                                                   java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List of BOMNode).
        Parameters:
        dctx - the distach context
        context - the context
        Returns:
        returns the list of products in packages