diff --git a/AlgebraicDataflowArchitectureModel/models/InventoryManagement.model b/AlgebraicDataflowArchitectureModel/models/InventoryManagement.model index 31bcdad..578d56c 100644 --- a/AlgebraicDataflowArchitectureModel/models/InventoryManagement.model +++ b/AlgebraicDataflowArchitectureModel/models/InventoryManagement.model @@ -1,10 +1,7 @@ channel ItemRegistration { - out inventory(itemDB:Map, registerItem(itemId:Str, itemName:Str, quantity:Int)) = insert(itemDB, itemId, {"count": quantity, - "name": itemName}) + out inventory(itemDB:Map, registerItem(itemId:Str, itemName:Str, quantity:Int)) = insert(itemDB, itemId, {"count": quantity, "name": itemName}) } channel ReceivingOrShipping(itemId:Str) { - out inventory.{itemId}.count(prev_quantity:Int, receiveOrShip(quantity:Int)) = if(prev_quantity + quantity >= 0, - prev_quantity + quantity, - prev_quantity) + out inventory.{itemId}.count(prev_quantity:Int, receiveOrShip(quantity:Int)) = prev_quantity + quantity }