Creating a pallet and adding the box to it

To create a pallet, we need to follow the same process as that for a FoodBox:

  1. In the left-hand panel, select Assets → FoodBoxPallet, and in the upper-right corner, click on + Create New Asset.
  2. Then, fill the JSON with the following data. Make sure that you were using the same FoodBox ID in the foodBoxInPallet field and the Warehouse ID (3) in the owner field:
{
"$class": "org.hyperledger.composer.system.AddAsset",
"resources": [
{
"$class": "com.packtpublishing.businessnetwork.foodsafety.FoodBoxPallet",
"foodBoxPalletIdentifier": "3485",
"foodBoxInPallet": "resource:com.packtpublishing.businessnetwork.foodsafety.FoodBox#2473",
"assetTrackingInformation": [],
"measureTrackingInformation": [],
"owner": "resource:com.packtpublishing.businessnetwork.foodsafety.Warehouse#3"
}
],
"targetRegistry": "resource:org.hyperledger.composer.system.AssetRegistry#com.packtpublishing.businessnetwork.foodsafety.FoodBoxPallet",
"transactionId": "0dfe3b672a78dd1d6728acd763d125f813ed0ca74450a2596b9cf79f47f054ad",
"timestamp": "2018-12-24T14:43:34.217Z"
}
  1. After creating the pallet, transfer both the pallet and box to the transporter, as before. The owner value of the JSON should be as follows:
 "owner": "resource:com.packtpublishing.businessnetwork.foodsafety.Transporter#2"
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.213.238