Concepts and enumerations

It's a good practice to create combined data types that are common among assets, participants, and transactions by creating more readable structures in Hyperledger Composer. These structures are concepts and enumerations.

We will use the following structures in the solution:

// Tracking information when an asset arrives or leaves a location
enum LocationStatus {
o ARRIVED
o IN_TRANSIT
o LEFT
}

// Location Types
enum LocationType {
o FACTORY
o WAREHOUSE
o TRANSPORTER
o STORE
}

// A measurement sent by the transporter sensor
concept Measurement {
o DateTime date
o Double value
}

// Check if it's in the factory, warehouse
concept Location {
o DateTime date
o LocationType location
o String locationIdentifier
o LocationStatus status
}

Next, we will look at how to define assets in the business network.

..................Content has been hidden....................

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