|
Algorithm 3 Creating a service request using the service broker. |
| Require: |
| B: Global state of the blockchain. |
| P: Service broker smart contract caller. |
| : UUID of the request. |
| : Date and time when the request is created. |
| : Name of the requested service. |
| : ID of the device that provides the service. |
| : ID of the organization to which the device belongs. |
| : Request method. |
| : Optional arguments of the request. |
| Ensure: |
| Service request information is saved in the blockchain. |
| 1: if
GetCallerPermissions
then
|
| 2: return error ▹ Abort if caller is not allowed to update the blockchain |
| 3: end if
|
| 4: if
GetService
then
|
| 5: return error ▹ Abort if requested service is not registered |
| 6: end if
|
| 7: if
GetServiceRequest
then
|
| 8: return error ▹ Abort if service request already exists |
| 9: end if
|
| 10:
Serialize
|
| 11:
|
| 12: NotifyEvent
|
| 13: return
|