© Shilpa Karkeraa 2020
S. KarkeraaUnlocking Blockchain on Azurehttps://doi.org/10.1007/978-1-4842-5043-3_10

10. Puzzles and Exercises

Shilpa Karkeraa1 
(1)
Mumbai, India
 

This chapter helps to validate the learning curve over Blockchains and enables to design blockchain implementations. Attempt the challenges presented here hands-on to develop your skill. Refer back to the chapters relevant to the question. As the vision of this book is to enable readers from technical as well as non-technical backgrounds to be a part of the blockchain ecosystem, attempting this chapter is one of the validators as well as a catalyst to innovate further.

The exercises cover the following:
  • Terminology

  • Consensus algorithms

  • Design challenges

  • Blockchain or not?

  • IoT with blockchain

  • Smart contracts

  • Mind maps

Remember: These exercises may have more than one correct answer. Also, as this is a field of innovation, the facts may evolve to a different form of existence. However, the fundamentals of decentralization, transparency, encryption, and immutability will remain the same. One may reflect upon the past chapters in different ways on every iteration of study.

Throughout the book, we have examined various use cases across different industries. Before you start the exercises, choose one of the roles and view the challenges from that user’s lens.

For example, if you read this book as a business developer, look at the infrastructure impact around the platform, the kind of people to interact with on-chain, and the policies that will have to be formed off-chain as well as on-chain. The challenges with respect to design will help you identify the right stakeholders to facilitate such a decentralized ecosystem.

If you read as a solution architect, draw out the variables internal to the platform. Analyze the changes in these variables. Focus on the pros and cons of each variable from your standpoint. Identify various technology stack options for every use case and its maturity for each use case.

If you read as a developer, focus on the tangibility of existing solutions with respect to the problem definitions at hand. To ensure building capabilities for better consensus algorithms and smart contracts, practice flow charts of execution, pseudo codes of business conditions, and user stories, and finally form it in the code. This code syntax may evolve from platform to platform; however, the fundamental logic will remain the same.

Attempt these challenges with the focus and vision that you are working for. If you are working in a team comprising a business developer, a solution architect, and a developer, the book encourages you to solve the challenges individually and exchange notes to have a broader understanding from different perspectives and roles.

Solutions are provided at the end of the chapter.

Getting Terminologies and Definitions Right

Crossword 1

../images/474923_1_En_10_Chapter/474923_1_En_10_Figa_HTML.jpg

Crossword 2

../images/474923_1_En_10_Chapter/474923_1_En_10_Figb_HTML.jpg

Crossword 3

../images/474923_1_En_10_Chapter/474923_1_En_10_Figc_HTML.jpg

Crossword 4

../images/474923_1_En_10_Chapter/474923_1_En_10_Figd_HTML.jpg

Choose the Suitable Form of Consensus

Match the three columns of consensus, blockchain, and features by drawing lines and linking the correct trio.

Consensus Mechanisms

Blockchain Platform

Features

1. Proof of Work

a. NEM

../images/474923_1_En_10_Chapter/474923_1_En_10_Fige_HTML.gif

2. Proof of Importance

b. EOS

../images/474923_1_En_10_Chapter/474923_1_En_10_Figf_HTML.gif

3. Federated Byzantine Agreement

c. Ethereum

../images/474923_1_En_10_Chapter/474923_1_En_10_Figg_HTML.gif

4. Delegated Proof of Stake

d. Stellar

../images/474923_1_En_10_Chapter/474923_1_En_10_Figh_HTML.gif

Use Case Design Challenge

../images/474923_1_En_10_Chapter/474923_1_En_10_Figi_HTML.gif

A farm of one acre is purchased by four friends in the percentage of stake as shown in the pie chart.

They agree to run a farming business together on the land. John does not live close to the land, thereby would not be around to work on it; he wants to rent or sell parts of the land. Tom has a full-time job and will work after his working hours. Ron lives beside the farm, but has no knowledge of farming. Joe is fully available to work on the farm as well and has complete knowledge and experience.

They decide to gain consensus of all involved to make every decision. Therefore, you have to design a blockchain platform for all activities that are going to be conducted on-chain. In the following sections, write the advantages and drawbacks of each type of consensus for its suitability to this situation. List the activities that can work under each type of consensus.

Example Solution

Proof of Work

Activities on-chain:
  • Land registry and underwritings

  • Ownership and sectoring of land

  • Adding users on submission of documents and validation by peers

  • Request for join budgets and cost claims on upload of receipts such as property tax, electricity, and water

  • Profit share can be initiated when revenue crosses 2x of investments as per smart contract

Advantages:
  • On-chain decisions have tamper-proof records of all activities for new users to preview.

  • Paper trail of all transactions can be found on-chain.

Limitations:
  • John cannot sell the land to any random user till he has all the conditions of the smart contract fulfilled and validated by peers.

  • Tom, who works after hours for the farm, does not get profit-share returns until the consensus clause is fulfilled.

  • Ron wants to expand his courtyard for parties and weddings but cannot do so until validation across the chain is met.

  • Joe, who works full time, wishes to hire more people on the farm but cannot do so until he gains validation from all.

Now that we have evaluated one form of consensus for this set of activities, list out activities and their suitability to the mentioned form of consensus. Remember, as a part of studying, developing, and forming blockchains, one is free to design as required with the choice best suited to the scenario.

Proof of Stake

Activities using this form of consensus are purely based on the stake of ownership in the unsectored land. It requires the block proposer to gain validation from the high-stake holders through the voting mechanism based on the weight of stakes.

If validator nodes based on their weight form the majority, the block transaction is allowed.

For example:

If

W1 x1 + W2 x2 + W3 x3 + W4 x4 + W5 x5 > 60%

then
  • Allow block transaction activities

where weights are proportional to the actual stakes.

Activities on-chain:
Advantages:
Limitations:

Delegated Proof of Stake

This consensus algorithm tries to decentralize further from PoS to enable a fairer voting mechanism. The algorithm delegates and reassigns weights for various activities at random. This can be pre-defined or chosen at random or delegated every cycle by the owner of stake.

Activities on-chain:
Advantages:
Limitations:

Directed Acyclic Graphs (DAG)

In the traditional forms of consensus observed in Bitcoin and Ethereum blockchains, the scalability and the latency time have been of increasing concern with the increase of their popularity and adoption. Therefore Directed Acyclic Graphs , a well-known graph data structure, can provide a method for a common consensus policy to maintain the shared ledger in a acyclic, low-latency, non-mining-dependent, pruned, lightweight-transactions manner on-chain.

Several blockchains generate variants of DAG based on the activity on-chain. For example, if there are 25 retailers on-chain selling different items in different sectors with entirely unique customer profiles, the blockchain ledger could be a DAG, where each transaction entry for every retailer is independent of the other retailers. This could be viewed as a side-chain activity that runs in a silo. However, the data needs to be tamper-proof, locked onto a decentralized chain.

Activities on-chain:
Advantages:
Limitations :

Federated Byzantine Agreement (FBA)

Remember: John is not always online to be involved in all activities for the farm. However, the group wants to ensure fair decisions that are transparent and agreeable to the chain node members. John, being a major stakeholder, becomes a bottleneck validator in the case of other mechanisms of consensus. FBA provides a fault-tolerant method to validate transactions on-chain. Identify the activities that require such a mechanism.

Activities on-chain:
Advantages:
Limitations:

Proof of Importance

Importance could be a metric on-chain over which decisions can be made. For example, a real-time surgery in a hospital might be of higher importance than a dental check-up; therefore the hospital policies for these scenarios are graded accordingly. Similarly, in this use case of farmland, a hazardous situation in the field might require faster decision-making. Or the most active member on-chain might get the authority to validate the transaction. So, this mechanism is not merely limited to the definition by NEM, but may be defined as required.

After defining the activities and node types, analyze the suitable token mechanics to govern the laws of the chain.

For example, NEM is defined at the following:
https://nem.io/wp-content/themes/nem/files/NEM_techRef.pdf

Similarly, one can define their own scoring formulae.

Activities on-chain:
Advantages:
Limitations:

Note that the consensus might not be a single mechanism but rather a synergistic design of methods that enforce a common policy across the chain to provide attack resistance and asynchronous race conditions.

Now we have considered different scenarios with different forms of consensus. One can always build a hybrid network of blockchains for different purposes with different types of users. For example, a simple landowner registry might not require consensus validation from every node and may be relevant to just the owner if the land is entirely independent. However, if it is shared land, one can choose to agree on a common consensus for various activities on a traceable ledger of records of every action.

Hybrid Chain

Such a blockchain maintains high transparency for all involved as well as allows prospective buyers to have a single source of shared truth.
../images/474923_1_En_10_Chapter/474923_1_En_10_Figj_HTML.jpg

Your task is to fill in the public nodes in the above hybrid chain for the landowner registry use case.

Data and Transactions

The city of Xoroville has agreed to maintain all health records and medical activities. Your job is to list the data and transactions that occur on the public chain and on the private chain.
../images/474923_1_En_10_Chapter/474923_1_En_10_Figu_HTML.png

Energy Allocation

Energy allocation inside a huge plant of 25 factories requires a blockchain to enable a shared ledger of data to trace electricity requirements.

Debate using the tools provided in the book whether a blockchain is required or not. Identify the exact circumstances where it is truly required.
../images/474923_1_En_10_Chapter/474923_1_En_10_Figv_HTML.png

Now that you have identified the exact case where it is required, identify the peer nodes that are required to be on-chain and off-chain.

Note

Peer nodes may or may not be end users. They can be users, machinery, sensors, and so forth.

../images/474923_1_En_10_Chapter/474923_1_En_10_Figw_HTML.png

Gadgets

Two questions about gadgets:
  • Identify five gadgets around you that need to be in consensus to work.

  • Identify five gadgets around you that need to be in consensus to work for a chemical factory.

Transparent Updates and Fair Trade

Identify a use case where IoT, blockchains, and human interventions can form a decentralized ecosystem of transparent updates and fair trade with smart contracts.

Having understood the design thought process for IoT integrations with blockchain, one can structure the platform with Azure components. Azure provides an array of options to configure the choice of blockchain with its workbench to connect with IoT devices along with other logic apps.

Depending on the design architected, one can decide to invoke the blockchain based on the integrations and the pre-defined conditions. For example, every time the sensor crosses a threshold, the blockchain would want to record it for audit purposes. So, when the sensor data crosses the threshold, the API to the blockchain is called. The DLT services ensure the hashing and generation of blocks is processed on the piece of data and it is added to the blockchain ledger.

However, it must be made clear that for a direct monitoring and alarm system that connects to the IoT, a blockchain may not be required. Therefore the Power BI can directly be connected to the off-chain DB as shown. The purpose of the blockchain ledger would be to maintain immutable records, enable an audit to trace all states of the sensory data, to ensure consensus is maintained in a forwarding system dependent on the sensory data, and so on.

One such example could be oxygen cylinders’ sensor data that may be connected to life support, incubation centers, child care, and so on. With a requirement to maintain such information for hospital audits, such sensor data can be stored on this tamper-proof blockchain ledger, which is linked to a chain of devices. The level of supply can be continuously checked for its state at all nodes.

JSON Preparation

Create the JSON config pseudo code and the state diagram for the following use case: the blockchain platform captures every state and state change that occurs while invoking the smart contract conditions. Learning from the official smart contract flow for a wheel-alignment system, observe the JSON preparation steps:
  1. 1.

    Define the user types.

     
  2. 2.

    Define the states.

     
  3. 3.

    Draw the processes/steps to the ideal condition.

     
  4. 4.

    Decide the states on user activity.

     

Fixing Pain Points

In this section, let us examine existing off-chain scenarios and their drawbacks. As solution architects, fix the pain points identified with the blockchain solutions in the following image.
../images/474923_1_En_10_Chapter/474923_1_En_10_Figk_HTML.jpg

The elements of this supply chain are highly disconnected from each other as far as understanding the supply demand in terms of cost of inventory, stocking, and runout. This is because the communication between all stakeholders is limited and there is zero transparency of the end user’s order. Most of these small-scale entities predict the demand flow in a silo, causing costs when not computed based on the entire chain’s movements.

To understand more, play the game here: https://beergame.masystem.se/

Now that we understand the off-chain problem, design an entire blockchain solution with the following steps:
  1. 1.

    Choose stakeholders and roles.

     
  2. 2.

    Choose the blockchain configuration and linkages.

     
  3. 3.

    Choose the consensus type.

     
  4. 4.

    Choose the platform based on Step 3.

     
  5. 5.

    Measure the scalability requirements.

     
  6. 6.

    Define the token economics if required.

     
  7. 7.

    Set up the states and conditions of the smart contracts.

     
  8. 8.

    Draw the chain view of the consortium blockchain.

     

So, now that you have learned to choose the correct form of consensus for a real-life scenario, identified off-chain and on-chain activities, and selected the right set of peer nodes, validator nodes, and blockchain configuration in the consortium, let’s see the solutions in the following sections.

Solutions

Crossword 1

../images/474923_1_En_10_Chapter/474923_1_En_10_Figl_HTML.jpg

Crossword 2

../images/474923_1_En_10_Chapter/474923_1_En_10_Figm_HTML.jpg

Crossword 3

../images/474923_1_En_10_Chapter/474923_1_En_10_Fign_HTML.jpg

Crossword 4

../images/474923_1_En_10_Chapter/474923_1_En_10_Figo_HTML.jpg

Matched Ordering Sequence

  • 1 – C – Chart 4

  • 2 – A – Chart 2

  • 3 – D – Chart 1

  • 4 – B – Chart 3

Proof of Stake Design Challenge

Activities on chain:
  • Sale/lease of the land

  • Addition of new stakeholders

  • Approval of budget proposals

  • Allocation of funds

  • Immovable asset building

Advantages:
  • Control among high-stake holders

  • Chance to gather together to form majority even for a small stakeholder

  • Raise proposal requests on chain transparently

  • Track fund allocations based on consensus

  • Transparent investment decisions

Limitations:
  • Low control for minority voters and stakeholders

  • Concentrated power by a group of nodes

  • Rigidity and influence of majority stakeholders

  • No avenue for decision-making for very low-stake holder groups

  • Cannot be expanded to other users, third parties who do not have a stake to be a part of any decision-making or services on chain

By understanding the advantages and disadvantages of the methods of PoW and PoS, existing blockchain networks like Ethereum are now migrating to the hybrid model of PoW/PoS. One may decide to formulate PoW for a set of activities such as block creation and generation; and PoS to validate and approve as per smart contracts. This confluence of methods might help to eliminate disadvantages such as attacks, biases, and so on. Study the latest Ethereum Yellow Paper here:
https://ethereum.github.io/yellowpaper/paper.pdf

On studying the yellow paper, one could construct such a blockchain configuration either with the Azure Workbench or simply by utilizing a group of Ubuntu servers on Azure, with emulation of the nodes done through the docker files. Each server may be a node or a group of nodes on the virtual instances inside a server. Once the role allocation of the server allocation is clear, the user can connect the end points of each server to the event register, which can invoke the smart contract on top of it.

Delegated Proof of Stake

Activities on chain:
  • Nomination of stake responsibility

  • Task allocation and ownership

  • Inclusion of third-party nodes, users, services

  • Delegation to new farming professionals to work actively on behalf of stake owner

  • Tenants on farm may be delegated some stake for certain activities

Advantages:
  • Shared decentralized balanced forms of responsibility

  • Avenue for low-stake holders to gain delegated stakes for various transactions/activity

  • Failsafe method to avoid concentration of power based on pre-defined stakes

  • Inclusion of new nodes can be onboarded based on random consensus of on-chain delegated nodes.

  • Allows expansion of on-chain activities with decentralization and inclusion

  • Low energy consumption

  • Low latency periods

Limitations:
  • Vulnerable to centralization and biases

  • Fake consensus by delegated nodes to create false transaction, which may not be in the best interests of the original stakeholder

  • Exclusion of non-delegated stakeholders

One example of a variant of Proof of Stake is Harmony. Harmony enables an adaptive threshold mechanism for various stake requirements for various activities. Nodes that qualify for the value of stake may participate. Harmony maintains its scalability and decentralization by sharding the network, data, and the states of transaction entirely. The sharding mechanism is non-uniform, scalable, and secure throughout. The consensus combines the Adaptive PoS with FBFT (Fast Byzantine Fault Tolerance), making it fault tolerant, distributed, and able to support high-speed transactions.

Directed Acyclic Graphs (DAG)

Activities:
  1. 1.

    Daily video feeds of the farms

     
  2. 2.

    Sensor based IoT feeds

     
  3. 3.

    Internal micro-transactions between Joe and Ron

     
  4. 4.

    Localized validations

     
  5. 5.

    Easily expandable to other nodes external to the core stakeholders for activities such as plumbing, electricity, notarization, etc.

     
  6. 6.

    Export of farming produce

     
  7. 7.

    Import and inventory management of seeds, farming material, etc.

     
  8. 8.

    Third-party integration triggers for security, fire hazards, etc.

     
Advantages:
  1. 1.

    Validation responsibility is a natural progression by later block producers.

     
  2. 2.

    Shared ledger information management does not require manual validation every time, thereby allowing IoT data to be appended to the immutable ledger seamlessly.

     
  3. 3.

    Allows offline status of nodes for transactions that may be irrelevant to someone like John and still maintains records for later awareness for such stakeholders.

     
  4. 4.

    Allows high-speed data transmission

     
Disadvantages
  1. 1.

    Disconnect from snoozed nodes

     
  2. 2.

    A one-way street of data ingestion and validation

     
  3. 3.

    Vulnerable to attacks

     
  4. 4.

    Prone to centralization

     

Federated Byzantine Agreement

Activities:
  1. 1.

    Approval for micro-budget transactions

     
  2. 2.

    Addition of family nominees or trusted known node users

     
  3. 3.

    Fixing of maintenance items on-field

     
  4. 4.

    Upload of bills and receipts

     
  5. 5.

    Regular activities on-field

     
Advantages:
  1. 1.

    Highly fault tolerant

     
  2. 2.

    Enables faster decision-making

     
  3. 3.

    Allows transactions

     
  4. 4.

    Allows non-trivial information to be added with curated validation of random nodes

     
Disadvantages:
  1. 1.

    Suited only for a certain set of activities that are limited to non-trivial decisions

     
  2. 2.

    Fault tolerance assumes bypassing crucial node members is fine

     

Proof of Importance

John, Ron, Tom, and Joe decide to rank all the preceding listed activities and decide that based on the work they do, importance scores will be earned on-chain. For example, John ensured all paperwork regarding the land was perfect and was uploaded on the ledger. So, apart from being a high-stake holder of land, he contributed to crucial activities, incentivizing him on-chain. Similarly, others are enabled to complete tasks and gain importance. However, a high importance score holder can allow the next task assignment. The scores are reviewed every seven days, and the validators shift based on the score. This is the agreement that was locked in under Proof of Importance.

Activities:
  1. 1.

    Incentivizing employees for contributions and actions

     
  2. 2.

    Incentivizing third-party entities that interact with this chain

     
  3. 3.

    Incentivizing a highly active member who works for the farm

     
  4. 4.

    Linkage of performance to importance

     
Advantage:
  1. 1.

    Provides an avenue for a low-stake holder like Joe to gain importance as well as value based on his contribution

     
  2. 2.

    Allows shift of authority based on engagement and involvement

     
Disadvantage:
  1. 1.

    Hoarding of power, value generated on chain

     
  2. 2.

    High dependency on network-driven activities

     
  3. 3.

    Decentralization may cause complete loss of control in some situations where governance is required.

     
  4. 4.

    May require revision or a hard fork to change policies

     

Hybrid Chain

Such a Blockchain maintains high transparency for all involved as well as allows prospective buyers to have a single source of shared truth.
../images/474923_1_En_10_Chapter/474923_1_En_10_Figp_HTML.jpg

Data and Transactions

Public Chain

Private Chain

Data

Transaction Activity

Data

Transaction Activity

General demographics

Pathology lab audits

Detailed blood reports

Doctor patient transactions

BMI

Hospital inspection checks

Surgery records

Hospital patient transactions

Anonymous Names

Doctor education and work experience history

Therapy session details

Pharmacy patient transactions

Area of Diagnostics

Purchase of general medical items

Family history

Insurance claim transactions

Blood Group

Purchase of medical instruments and quality

X-rays, sonography

Financial transactions

General Blood Reports

Blood donation

Genetic trace and DNA

 

Doctors Records

Organ donation with anonymous donors

Biometrics

 

Hospital Records

   

Insurance Certificates

   

Energy Allocation

Required

Not Required

When one factory proportionately increases or decreases consumption for other 24 based on its operations.

When 25 factories have no dependency on each other over electricity consumption.

When Smart Meters are everywhere and data can be integrated seamlessly

When this data is populated purely by manual intervention and meter readings

When this data affects the costs of the produce, must be highly sensitive.

When this data does not affect overall operations and the requirements are highly stable every year.

On-Chain Entities

Off-Chain Entities

Records of electricity consumption data from Smart Meters

Aggregation of one-time data of machinery that are not connected to the main line, but use batteries

Operation managers, which manage the electricity usage

Forecast of further electricity consumption

Bill invoices to 25 factories

M&A of factories

Disbursement and payments of bills

Faulty meter checks

Transfer of stakeholders

 

Gadgets

../images/474923_1_En_10_Chapter/474923_1_En_10_Figq_HTML.jpg
../images/474923_1_En_10_Chapter/474923_1_En_10_Figr_HTML.jpg

Transparent Updates and Fair Trade

Consider a scenario where organs for transplant have to be transported. The hospital patient who subscribes to the service as well as the doctor gets to see the quality of the transfer throughout the transport.

The blockchain ledger can have the following nodes:
../images/474923_1_En_10_Chapter/474923_1_En_10_Figs_HTML.jpg

This private chain has a bound smart contract that has all conditions of a proper transplant requirement. If the IOT nodes satisfy, it finally requires the doctor’s on-chain signature along with the patient’s multi-sign on the acknowledgment. This permissioned chain enables a transparent process that may be tamper-proof on a decentralized system. Therefore, blockchains here make ideal sense.

JSON Preparation

{
  "ApplicationName": "WheelalignmentCheck",
  "DisplayName": "Service Contract for Wheel Alignment",
  "Description": "...",
  "ApplicationRoles": [
    {
      "Name": "Technician",
      "Description": "Contractor who aligns the wheel."
    },
    {
      "Name": "Car Owner",
      "Description": "Requests for Service"
    }
  ],
  "Workflows": [
    {
      "Name": "Wheel Alignment",
      "DisplayName": "Wheel Alignment",
      "Description": "...",
      "Initiators": [ "Technician" ],
      "StartState":  "Created",
      "Properties": [
        {
          "Name": "State",
          "DisplayName": "State",
          "Description": "Holds the state of the contract",
          "Type": {
            "Name": "state"
          }
        },
        {
          "Name": "Technician",
          "DisplayName": "Technician",
          "Description": "...",
          "Type": {
            "Name": "Technician"
          }
        },
        {
          "Name": "Car Owner",
          "DisplayName": "Car Owner",
          "Description": "...",
          "Type": {
            "Name": "Car Owner"
          }
        },
        {
          "Name": "Target Wheel Angle",
          "DisplayName": "Target Wheel Angle",
          "Description": "...",
          "Type": {
            "Name": "int"
          }
        },
        {
          "Name": "Mode",
          "DisplayName": "System Mode",
          "Description": "...",
          "Type": {
            "Name": "enum",
            "EnumValues": ["Misaligned", "Aligned", "Not mounted"]
          }
        }
      ],
      "Constructor": {
               "Parameters": [
                     {
                         "Name": "WA Technician",
                         "Description": "...",
                         "DisplayName": "Technician",
                         "Type": {
                           "Name": "Technician"
                         }
                     },
                     {
                         "Name": "WA Car Owner",
                         "Description": "...",
                         "DisplayName": "Car Owner",
                         "Type": {
                           "Name": "Car Owner"
                         }
                     }
                   ]
      },
        "Functions": [
        {
          "Name": "Start Wheel Alignment",
          "DisplayName": "Start Wheel Alignment"",
          "Description": "...",
          "Parameters": []
        },
        {
          "Name": "Set Wheel Angle",
          "DisplayName": "Set Wheel Angle",
          "Description": "...",
          "Parameters": [
            {
              "Name": "target",
              "Description": "...",
              "DisplayName": "Target Wheel Angle",
              "Type": {
                "Name": "int"
              }
            }
          ]
        },
                 {
          "Name": "SetMode",
          "DisplayName": "Set Mode",
          "Description": "...",
          "Parameters": [
            {
              "Name": "mode",
              "Description": "...",
              "DisplayName": "Mode",
              "Type": {
                "Name": "enum",
                "EnumValues": ["Misaligned", "Aligned", "Not mounted"]
              }
            }
          ]
        }
        ],
        "States": [
             {
          "Name": "Request Created",
          "DisplayName": "Created",
          "Description": "...",
          "PercentComplete": 20,
          "Style": "Success",
          "Transitions": [
                   {
              "AllowedRoles": [],
              "AllowedInstanceRoles": ["Technician"],
              "Description": "...",
              "Function": "Start Wheel Alignment",
              "NextStates": [ "Aligning" ],
              "DisplayName": "Start Wheel Alignment"
            }
               ]
             },
             {
          "Name": "Aligning",
          "DisplayName": "Aligning",
          "Description": "...",
          "PercentComplete": 70,
          "Style": "Success",
          "Transitions": [
                   {
              "AllowedRoles": [],
              "AllowedInstanceRoles": ["Car Owner"],
              "Description": "...",
              "Function": "SetTargetWheelAngle",
              "NextStates": ["Aligning"],
              "DisplayName": "Set TargetWheelAngle"
            },
                   {
              "AllowedRoles": [],
              "AllowedInstanceRoles": ["Car Owner"],
              "Description": "...",
              "Function": "SetMode",
              "NextStates": ["Aligning"],
              "DisplayName": "Set Mode"
            }
               ]
             }
        ]
      }
   ]
}

State Diagram

../images/474923_1_En_10_Chapter/474923_1_En_10_Figt_HTML.png

Fixing Pain Points

The solution is open to numerous alternatives; left to the reader’s interpretation.

References to our version of implementation can be derived from the previous chapters, such as the BBChain View.

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

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