Docs‎ > ‎Reactive Logic Tutorial‎ > ‎

Bill of Materials Kit Explosion


While described here as a separate topic, this is a requirement within Place Order. When ordering a Product that is a kit (i.e., composed of other Parts, such as a plane with Wings etc), we want to reduce inventory for each of the components of the kit.

The key requirement is to populate the SubItems for a kit-based Lineitem. See the database structure - subItems are a child of LineItem objects, representing the bill of materials explosion. The solution is to use the Insert Into From rule extension: see the first action rule in the following image. The qtyOrdered rule computes computes the item quantity for kits (for non-kits, it simply returns / defaults the entered value).

The entire solution requires four rules. Some of the lines above are summaries; we show the full logic here. The complete event definition is shown in the following image (this recursively creates the sub-items from each item):

The complete definition of quantity_ordered is a good illustration of conditional logic, here depending on whether the lineitem is a sub-item:

Explore the Bill of Materials Kit Explosion

You can use the Rest Lab to POST the following to a URL such as:

http://.../APICreator/rest/demo/sample/v1/cust.orders_c


{
   "customer":"Alpha and Sons",
   "IsReady":false,
   "items_o":[
      {
         "ProductName":"Boing 747",
         "QuantityOrdered":2
      }
   ]
}

ċ
Allocation.png
(274k)
Michael Holleran,
Feb 16, 2016, 3:23 PM
ċ
Kahuna Sample Diagram.png
(265k)
Michael Holleran,
Feb 16, 2016, 3:23 PM
ċ
Sample Logic.png
(147k)
Michael Holleran,
Feb 16, 2016, 3:23 PM
ċ
Screen Shot 2013-05-07 at 5.34.15 PM | May 7, 2013.png
(216k)
Michael Holleran,
Feb 16, 2016, 3:23 PM
Comments