Class BOMServices
java.lang.Object
org.apache.ofbiz.manufacturing.bom.BOMServices
Bills of Materials' services implementation.
These services are useful when dealing with product's
bills of materials.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateShipmentPackages
(DispatchContext dctx, Map<String, ? extends Object> context) getBOMTree
(DispatchContext dctx, Map<String, ? extends Object> context) getManufacturingComponents
(DispatchContext dctx, Map<String, ? extends Object> context) It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List ofBOMNode
).getMaxDepth
(DispatchContext dctx, Map<String, ? extends Object> context) Returns the product's low level code (llc) i.e.getNotAssembledComponents
(DispatchContext dctx, Map<String, ? extends Object> context) getProductsInPackages
(DispatchContext dctx, Map<String, ? extends Object> context) It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List ofBOMNode
).initLowLevelCode
(DispatchContext dctx, Map<String, ? extends Object> context) Updates the product's low level code (llc) for all the products in the Product entity.searchDuplicatedAncestor
(DispatchContext dctx, Map<String, ? extends Object> context) Returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present, null otherwise.updateLowLevelCode
(DispatchContext dctx, Map<String, ? extends 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).
-
Constructor Details
-
BOMServices
public BOMServices()
-
-
Method Details
-
getMaxDepth
public static Map<String,Object> getMaxDepth(DispatchContext dctx, Map<String, ? extends 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 contextcontext
- the context- Returns:
- returns the product's low level code (llc) i.e. the maximum depth
-
updateLowLevelCode
public static Map<String,Object> updateLowLevelCode(DispatchContext dctx, Map<String, ? extends 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 contextcontext
- the context- Returns:
- the results of the updates the product's low level code
-
initLowLevelCode
public static Map<String,Object> initLowLevelCode(DispatchContext dctx, Map<String, ? extends 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 contextcontext
- the context- Returns:
- the results of the updates the product's low level code
-
searchDuplicatedAncestor
public static Map<String,Object> searchDuplicatedAncestor(DispatchContext dctx, Map<String, ? extends 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 contextcontext
- the context- Returns:
- returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present
-
getBOMTree
public static Map<String,Object> getBOMTree(DispatchContext dctx, Map<String, ? extends Object> context) It reads the product's bill of materials, if necessary configures it, and it returns an object (seeBOMTree
andBOMNode
) that represents a configured bill of material tree. Useful for tree traversal (breakdown, explosion, implosion).- Parameters:
dctx
- the distach contextcontext
- the context- Returns:
- return the bill of material tree
-
getManufacturingComponents
public static Map<String,Object> getManufacturingComponents(DispatchContext dctx, Map<String, ? extends Object> context) It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List ofBOMNode
).- Parameters:
dctx
- the distach contextcontext
- the context- Returns:
- return the list of manufacturing components
-
getNotAssembledComponents
-
createShipmentPackages
-
getProductsInPackages
public static Map<String,Object> getProductsInPackages(DispatchContext dctx, Map<String, ? extends Object> context) It reads the product's bill of materials, if necessary configures it, and it returns its (possibly configured) components in a List ofBOMNode
).- Parameters:
dctx
- the distach contextcontext
- the context- Returns:
- returns the list of products in packages
-