Class BOMServices
- java.lang.Object
-
- org.apache.ofbiz.manufacturing.bom.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.
-
-
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)
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 ofBOMNode
).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 ofBOMNode
).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).
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
-
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 contextcontext
- 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 contextcontext
- 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 contextcontext
- 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 contextcontext
- 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 (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 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 ofBOMNode
).- Parameters:
dctx
- the distach contextcontext
- 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 ofBOMNode
).- Parameters:
dctx
- the distach contextcontext
- the context- Returns:
- returns the list of products in packages
-
-