To create a pallet, we need to follow the same process as that for a FoodBox:
- In the left-hand panel, select Assets → FoodBoxPallet, and in the upper-right corner, click on + Create New Asset.
- 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"
}
- 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"