Class BOMNode

java.lang.Object
org.apache.ofbiz.manufacturing.bom.BOMNode

public class BOMNode extends Object
An ItemCoinfigurationNode represents a component in a bill of materials.
  • Constructor Details

  • 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 id
      inDate - the in date
      productFeatures - the product features
      type - 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 id
      inDate - the in date
      productFeatures - the product features
      Throws:
      GenericEntityException - the generic entity exception
    • getParentNode

      public BOMNode getParentNode()
      Getter for property parentNode.
      Returns:
      Value of property parentNode.
    • getRootNode

      public BOMNode getRootNode()
      Gets root node.
      Returns:
      the root node
    • setParentNode

      public void setParentNode(BOMNode parentNode)
      Setter for property parentNode.
      Parameters:
      parentNode - New value of property parentNode.
    • print

      public void print(StringBuffer sb, BigDecimal quantity, int depth)
      Method used for TEST and DEBUG purposes
    • print

      public void print(List<BOMNode> arr, BigDecimal quantity, int depth, boolean excludeWIPs)
      Print.
      Parameters:
      arr - the arr
      quantity - the quantity
      depth - the depth
      excludeWIPs - the exclude wi ps
    • getProductsInPackages

      public void getProductsInPackages(List<BOMNode> arr, BigDecimal quantity, int depth, boolean excludeWIPs)
      Gets products in packages.
      Parameters:
      arr - the arr
      quantity - the quantity
      depth - the depth
      excludeWIPs - the exclude wi ps
    • sumQuantity

      public void sumQuantity(Map<String,BOMNode> nodes)
      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 id
      date - the date
      workEffortName - the work effort name
      description - the description
      routingId - the routing id
      orderId - the order id
      orderItemSeqId - the order item seq id
      shipGroupSeqId - the ship group seq id
      shipmentId - the shipment id
      useSubstitute - the use substitute
      ignoreSupplierProducts - the ignore supplier products
      Returns:
      the map
      Throws:
      GenericEntityException - the generic entity exception
    • getStartDate

      public Timestamp getStartDate(String facilityId, Timestamp requiredBydate, boolean allNodes)
      Gets start date.
      Parameters:
      facilityId - the facility id
      requiredBydate - the required bydate
      allNodes - the all nodes
      Returns:
      the start date
    • isWarehouseManaged

      public 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.
    • 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

      public void isConfigured(List<BOMNode> arr)
      Is configured.
      Parameters:
      arr - the arr
    • getQuantity

      public BigDecimal getQuantity()
      Getter for property quantity.
      Returns:
      Value of property quantity.
    • setQuantity

      public void setQuantity(BigDecimal quantity)
      Sets quantity.
      Parameters:
      quantity - the quantity
    • getDepth

      public int getDepth()
      Getter for property depth.
      Returns:
      Value of property depth.
    • getProduct

      public GenericValue getProduct()
      Gets product.
      Returns:
      the product
    • 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 String getRootProductForRules()
      Gets root product for rules.
      Returns:
      the root product for rules
    • getProductForRules

      public String getProductForRules()
      Getter for property productForRules.
      Returns:
      Value of property productForRules.
    • setProductForRules

      public void setProductForRules(String productForRules)
      Setter for property productForRules.
      Parameters:
      productForRules - New value of property productForRules.
    • getBomTypeId

      public String getBomTypeId()
      Getter for property bomTypeId.
      Returns:
      Value of property bomTypeId.
    • getQuantityMultiplier

      public BigDecimal getQuantityMultiplier()
      Getter for property quantityMultiplier.
      Returns:
      Value of property quantityMultiplier.
    • setQuantityMultiplier

      public void setQuantityMultiplier(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 BigDecimal getScrapFactor()
      Getter for property scrapFactor.
      Returns:
      Value of property scrapFactor.
    • setScrapFactor

      public void setScrapFactor(BigDecimal scrapFactor)
      Setter for property scrapFactor.
      Parameters:
      scrapFactor - New value of property scrapFactor.
    • getChildrenNodes

      public List<BOMNode> getChildrenNodes()
      Getter for property childrenNodes.
      Returns:
      Value of property childrenNodes.
    • setChildrenNodes

      public void setChildrenNodes(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)
      Sets tree.
      Parameters:
      tree - the tree
    • getTree

      public BOMTree getTree()
      Gets tree.
      Returns:
      the tree