Class BOMNode
java.lang.Object
org.apache.ofbiz.manufacturing.bom.BOMNode
An ItemCoinfigurationNode represents a component in a bill of materials.
-
Constructor Summary
ConstructorDescriptionBOMNode
(String productId, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin) BOMNode
(GenericValue product, LocalDispatcher dispatcher, GenericValue userLogin) -
Method Summary
Modifier and TypeMethodDescriptioncreateManufacturingOrder
(String facilityId, Date date, String workEffortName, String description, String routingId, String orderId, String orderItemSeqId, String shipGroupSeqId, String shipmentId, boolean useSubstitute, boolean ignoreSupplierProducts) Create manufacturing order map.Getter for property bomTypeId.Getter for property childrenNodes.int
getDepth()
Getter for property depth.Getter for property parentNode.Gets product.Getter for property productAssoc.Getter for property productForRules.void
getProductsInPackages
(List<BOMNode> arr, BigDecimal quantity, int depth, boolean excludeWIPs) Gets products in packages.Getter for property quantity.Getter for property quantityMultiplier.Gets root node.Gets root product for rules.Getter for property ruleApplied.Getter for property scrapFactor.getStartDate
(String facilityId, Timestamp requiredBydate, boolean allNodes) Gets start date.Getter for property substitutedNode.getTree()
Gets tree.void
isConfigured
(List<BOMNode> arr) Is configured.boolean
By default, a part is manufactured if it has child nodes and it has NO SupplierProducts definedboolean
isManufactured
(boolean ignoreSupplierProducts) A part is considered manufactured if it has child nodes AND unless ignoreSupplierProducts is set, if it also has no unexpired SupplierProducts definedboolean
Is virtual boolean.boolean
isWarehouseManaged
(String facilityId) Returns false if the product of this BOM Node is of type "WIP" or if it has no ProductFacility records defined for it, meaning that no active stock targets are set for this product.protected void
loadChildren
(String partBomTypeId, Date inDate, List<GenericValue> productFeatures, int type) Load children.protected void
loadParents
(String partBomTypeId, Date inDate, List<GenericValue> productFeatures) Load parents.void
print
(StringBuffer sb, BigDecimal quantity, int depth) Method used for TEST and DEBUG purposesvoid
print
(List<BOMNode> arr, BigDecimal quantity, int depth, boolean excludeWIPs) Print.void
setChildrenNodes
(List<BOMNode> childrenNodes) Setter for property childrenNodes.void
setParentNode
(BOMNode parentNode) Setter for property parentNode.void
setProductAssoc
(GenericValue productAssoc) Setter for property productAssoc.void
setProductForRules
(String productForRules) Setter for property productForRules.void
setQuantity
(BigDecimal quantity) Sets quantity.void
setQuantityMultiplier
(BigDecimal quantityMultiplier) Setter for property quantityMultiplier.void
setRuleApplied
(GenericValue ruleApplied) Setter for property ruleApplied.void
setScrapFactor
(BigDecimal scrapFactor) Setter for property scrapFactor.void
setSubstitutedNode
(BOMNode substitutedNode) Setter for property substitutedNode.void
Sets tree.void
sumQuantity
(Map<String, BOMNode> nodes) Sum quantity.
-
Constructor Details
-
BOMNode
-
BOMNode
public BOMNode(String productId, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin) throws GenericEntityException - Throws:
GenericEntityException
-
-
Method Details
-
loadChildren
protected void loadChildren(String partBomTypeId, Date inDate, List<GenericValue> productFeatures, int type) throws GenericEntityException Load children.- Parameters:
partBomTypeId
- the part bom type idinDate
- the in dateproductFeatures
- the product featurestype
- the type- Throws:
GenericEntityException
- the generic entity exception
-
loadParents
protected void loadParents(String partBomTypeId, Date inDate, List<GenericValue> productFeatures) throws GenericEntityException Load parents.- Parameters:
partBomTypeId
- the part bom type idinDate
- the in dateproductFeatures
- the product features- Throws:
GenericEntityException
- the generic entity exception
-
getParentNode
Getter for property parentNode.- Returns:
- Value of property parentNode.
-
getRootNode
Gets root node.- Returns:
- the root node
-
setParentNode
Setter for property parentNode.- Parameters:
parentNode
- New value of property parentNode.
-
print
Method used for TEST and DEBUG purposes -
print
Print.- Parameters:
arr
- the arrquantity
- the quantitydepth
- the depthexcludeWIPs
- the exclude wi ps
-
getProductsInPackages
public void getProductsInPackages(List<BOMNode> arr, BigDecimal quantity, int depth, boolean excludeWIPs) Gets products in packages.- Parameters:
arr
- the arrquantity
- the quantitydepth
- the depthexcludeWIPs
- the exclude wi ps
-
sumQuantity
Sum quantity.- Parameters:
nodes
- the nodes
-
createManufacturingOrder
public Map<String,Object> createManufacturingOrder(String facilityId, Date date, String workEffortName, String description, String routingId, String orderId, String orderItemSeqId, String shipGroupSeqId, String shipmentId, boolean useSubstitute, boolean ignoreSupplierProducts) throws GenericEntityException Create manufacturing order map.- Parameters:
facilityId
- the facility iddate
- the dateworkEffortName
- the work effort namedescription
- the descriptionroutingId
- the routing idorderId
- the order idorderItemSeqId
- the order item seq idshipGroupSeqId
- the ship group seq idshipmentId
- the shipment iduseSubstitute
- the use substituteignoreSupplierProducts
- the ignore supplier products- Returns:
- the map
- Throws:
GenericEntityException
- the generic entity exception
-
getStartDate
Gets start date.- Parameters:
facilityId
- the facility idrequiredBydate
- the required bydateallNodes
- the all nodes- Returns:
- the start date
-
isWarehouseManaged
Returns false if the product of this BOM Node is of type "WIP" or if it has no ProductFacility records defined for it, meaning that no active stock targets are set for this product. -
isManufactured
public boolean isManufactured(boolean ignoreSupplierProducts) A part is considered manufactured if it has child nodes AND unless ignoreSupplierProducts is set, if it also has no unexpired SupplierProducts defined- Parameters:
ignoreSupplierProducts
-- Returns:
- return if a part is considered manufactured
-
isManufactured
public boolean isManufactured()By default, a part is manufactured if it has child nodes and it has NO SupplierProducts defined- Returns:
- return if a part is manufactured
-
isVirtual
public boolean isVirtual()Is virtual boolean.- Returns:
- the boolean
-
isConfigured
Is configured.- Parameters:
arr
- the arr
-
getQuantity
Getter for property quantity.- Returns:
- Value of property quantity.
-
setQuantity
Sets quantity.- Parameters:
quantity
- the quantity
-
getDepth
public int getDepth()Getter for property depth.- Returns:
- Value of property depth.
-
getProduct
Gets product.- Returns:
- the product
-
getSubstitutedNode
Getter for property substitutedNode.- Returns:
- Value of property substitutedNode.
-
setSubstitutedNode
Setter for property substitutedNode.- Parameters:
substitutedNode
- New value of property substitutedNode.
-
getRootProductForRules
Gets root product for rules.- Returns:
- the root product for rules
-
getProductForRules
Getter for property productForRules.- Returns:
- Value of property productForRules.
-
setProductForRules
Setter for property productForRules.- Parameters:
productForRules
- New value of property productForRules.
-
getBomTypeId
Getter for property bomTypeId.- Returns:
- Value of property bomTypeId.
-
getQuantityMultiplier
Getter for property quantityMultiplier.- Returns:
- Value of property quantityMultiplier.
-
setQuantityMultiplier
Setter for property quantityMultiplier.- Parameters:
quantityMultiplier
- New value of property quantityMultiplier.
-
getRuleApplied
Getter for property ruleApplied.- Returns:
- Value of property ruleApplied.
-
setRuleApplied
Setter for property ruleApplied.- Parameters:
ruleApplied
- New value of property ruleApplied.
-
getScrapFactor
Getter for property scrapFactor.- Returns:
- Value of property scrapFactor.
-
setScrapFactor
Setter for property scrapFactor.- Parameters:
scrapFactor
- New value of property scrapFactor.
-
getChildrenNodes
Getter for property childrenNodes.- Returns:
- Value of property childrenNodes.
-
setChildrenNodes
Setter for property childrenNodes.- Parameters:
childrenNodes
- New value of property childrenNodes.
-
getProductAssoc
Getter for property productAssoc.- Returns:
- Value of property productAssoc.
-
setProductAssoc
Setter for property productAssoc.- Parameters:
productAssoc
- New value of property productAssoc.
-
setTree
Sets tree.- Parameters:
tree
- the tree
-
getTree
Gets tree.- Returns:
- the tree
-