Class BOMNode
- java.lang.Object
-
- org.apache.ofbiz.manufacturing.bom.BOMNode
-
public class BOMNode extends java.lang.Object
An ItemCoinfigurationNode represents a component in a bill of materials.
-
-
Field Summary
Fields Modifier and Type Field Description protected Delegator
delegator
protected LocalDispatcher
dispatcher
static java.lang.String
module
protected GenericValue
userLogin
-
Constructor Summary
Constructors Constructor Description BOMNode(java.lang.String productId, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin)
BOMNode(GenericValue product, LocalDispatcher dispatcher, GenericValue userLogin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
createManufacturingOrder(java.lang.String facilityId, java.util.Date date, java.lang.String workEffortName, java.lang.String description, java.lang.String routingId, java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String shipmentId, boolean useSubstitute, boolean ignoreSupplierProducts)
java.lang.String
getBomTypeId()
Getter for property bomTypeId.java.util.List<BOMNode>
getChildrenNodes()
Getter for property childrenNodes.int
getDepth()
Getter for property depth.BOMNode
getParentNode()
Getter for property parentNode.GenericValue
getProduct()
GenericValue
getProductAssoc()
Getter for property productAssoc.java.lang.String
getProductForRules()
Getter for property productForRules.void
getProductsInPackages(java.util.List<BOMNode> arr, java.math.BigDecimal quantity, int depth, boolean excludeWIPs)
java.math.BigDecimal
getQuantity()
Getter for property quantity.java.math.BigDecimal
getQuantityMultiplier()
Getter for property quantityMultiplier.BOMNode
getRootNode()
java.lang.String
getRootProductForRules()
GenericValue
getRuleApplied()
Getter for property ruleApplied.java.math.BigDecimal
getScrapFactor()
Getter for property scrapFactor.java.sql.Timestamp
getStartDate(java.lang.String facilityId, java.sql.Timestamp requiredBydate, boolean allNodes)
BOMNode
getSubstitutedNode()
Getter for property substitutedNode.BOMTree
getTree()
void
isConfigured(java.util.List<BOMNode> arr)
boolean
isManufactured()
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
isVirtual()
boolean
isWarehouseManaged(java.lang.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(java.lang.String partBomTypeId, java.util.Date inDate, java.util.List<GenericValue> productFeatures, int type)
protected void
loadParents(java.lang.String partBomTypeId, java.util.Date inDate, java.util.List<GenericValue> productFeatures)
void
print(java.lang.StringBuffer sb, java.math.BigDecimal quantity, int depth)
void
print(java.util.List<BOMNode> arr, java.math.BigDecimal quantity, int depth, boolean excludeWIPs)
void
setChildrenNodes(java.util.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(java.lang.String productForRules)
Setter for property productForRules.void
setQuantity(java.math.BigDecimal quantity)
void
setQuantityMultiplier(java.math.BigDecimal quantityMultiplier)
Setter for property quantityMultiplier.void
setRuleApplied(GenericValue ruleApplied)
Setter for property ruleApplied.void
setScrapFactor(java.math.BigDecimal scrapFactor)
Setter for property scrapFactor.void
setSubstitutedNode(BOMNode substitutedNode)
Setter for property substitutedNode.void
setTree(BOMTree tree)
void
sumQuantity(java.util.Map<java.lang.String,BOMNode> nodes)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
dispatcher
protected LocalDispatcher dispatcher
-
delegator
protected Delegator delegator
-
userLogin
protected GenericValue userLogin
-
-
Constructor Detail
-
BOMNode
public BOMNode(GenericValue product, LocalDispatcher dispatcher, GenericValue userLogin)
-
BOMNode
public BOMNode(java.lang.String productId, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin) throws GenericEntityException
- Throws:
GenericEntityException
-
-
Method Detail
-
loadChildren
protected void loadChildren(java.lang.String partBomTypeId, java.util.Date inDate, java.util.List<GenericValue> productFeatures, int type) throws GenericEntityException
- Throws:
GenericEntityException
-
loadParents
protected void loadParents(java.lang.String partBomTypeId, java.util.Date inDate, java.util.List<GenericValue> productFeatures) throws GenericEntityException
- Throws:
GenericEntityException
-
getParentNode
public BOMNode getParentNode()
Getter for property parentNode.- Returns:
- Value of property parentNode.
-
getRootNode
public BOMNode getRootNode()
-
setParentNode
public void setParentNode(BOMNode parentNode)
Setter for property parentNode.- Parameters:
parentNode
- New value of property parentNode.
-
print
public void print(java.lang.StringBuffer sb, java.math.BigDecimal quantity, int depth)
-
print
public void print(java.util.List<BOMNode> arr, java.math.BigDecimal quantity, int depth, boolean excludeWIPs)
-
getProductsInPackages
public void getProductsInPackages(java.util.List<BOMNode> arr, java.math.BigDecimal quantity, int depth, boolean excludeWIPs)
-
sumQuantity
public void sumQuantity(java.util.Map<java.lang.String,BOMNode> nodes)
-
createManufacturingOrder
public java.util.Map<java.lang.String,java.lang.Object> createManufacturingOrder(java.lang.String facilityId, java.util.Date date, java.lang.String workEffortName, java.lang.String description, java.lang.String routingId, java.lang.String orderId, java.lang.String orderItemSeqId, java.lang.String shipGroupSeqId, java.lang.String shipmentId, boolean useSubstitute, boolean ignoreSupplierProducts) throws GenericEntityException
- Throws:
GenericEntityException
-
getStartDate
public java.sql.Timestamp getStartDate(java.lang.String facilityId, java.sql.Timestamp requiredBydate, boolean allNodes)
-
isWarehouseManaged
public boolean isWarehouseManaged(java.lang.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.
-
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()
-
isConfigured
public void isConfigured(java.util.List<BOMNode> arr)
-
getQuantity
public java.math.BigDecimal getQuantity()
Getter for property quantity.- Returns:
- Value of property quantity.
-
setQuantity
public void setQuantity(java.math.BigDecimal quantity)
-
getDepth
public int getDepth()
Getter for property depth.- Returns:
- Value of property depth.
-
getProduct
public GenericValue getProduct()
-
getSubstitutedNode
public BOMNode getSubstitutedNode()
Getter for property substitutedNode.- Returns:
- Value of property substitutedNode.
-
setSubstitutedNode
public void setSubstitutedNode(BOMNode substitutedNode)
Setter for property substitutedNode.- Parameters:
substitutedNode
- New value of property substitutedNode.
-
getRootProductForRules
public java.lang.String getRootProductForRules()
-
getProductForRules
public java.lang.String getProductForRules()
Getter for property productForRules.- Returns:
- Value of property productForRules.
-
setProductForRules
public void setProductForRules(java.lang.String productForRules)
Setter for property productForRules.- Parameters:
productForRules
- New value of property productForRules.
-
getBomTypeId
public java.lang.String getBomTypeId()
Getter for property bomTypeId.- Returns:
- Value of property bomTypeId.
-
getQuantityMultiplier
public java.math.BigDecimal getQuantityMultiplier()
Getter for property quantityMultiplier.- Returns:
- Value of property quantityMultiplier.
-
setQuantityMultiplier
public void setQuantityMultiplier(java.math.BigDecimal quantityMultiplier)
Setter for property quantityMultiplier.- Parameters:
quantityMultiplier
- New value of property quantityMultiplier.
-
getRuleApplied
public GenericValue getRuleApplied()
Getter for property ruleApplied.- Returns:
- Value of property ruleApplied.
-
setRuleApplied
public void setRuleApplied(GenericValue ruleApplied)
Setter for property ruleApplied.- Parameters:
ruleApplied
- New value of property ruleApplied.
-
getScrapFactor
public java.math.BigDecimal getScrapFactor()
Getter for property scrapFactor.- Returns:
- Value of property scrapFactor.
-
setScrapFactor
public void setScrapFactor(java.math.BigDecimal scrapFactor)
Setter for property scrapFactor.- Parameters:
scrapFactor
- New value of property scrapFactor.
-
getChildrenNodes
public java.util.List<BOMNode> getChildrenNodes()
Getter for property childrenNodes.- Returns:
- Value of property childrenNodes.
-
setChildrenNodes
public void setChildrenNodes(java.util.List<BOMNode> childrenNodes)
Setter for property childrenNodes.- Parameters:
childrenNodes
- New value of property childrenNodes.
-
getProductAssoc
public GenericValue getProductAssoc()
Getter for property productAssoc.- Returns:
- Value of property productAssoc.
-
setProductAssoc
public void setProductAssoc(GenericValue productAssoc)
Setter for property productAssoc.- Parameters:
productAssoc
- New value of property productAssoc.
-
setTree
public void setTree(BOMTree tree)
-
getTree
public BOMTree getTree()
-
-