Spydra Docs
For Developers
Spydra Platform
Spydra Platform
  • GETTING STARTED
    • Introduction
    • Why Spydra?
    • Blockchain fundamentals
      • Why Blockchain?
      • Private Blockchain
      • Public Chain
    • 🎧Getting started with a Private Network
      • Creating an account
      • Creating an organization
      • Creating a Network
      • Apps
    • 🔊Getting started with a Token Store on Public Chain
      • Token store
      • Customise token store front
      • List a real world asset and issue tokens
      • Manage token lifecycle
    • Intro to Hyperledger Fabric
  • Products Overview
    • 🎧Private Network
      • Organizations
        • Users and Organizations
        • Organisation Hosting - Spydra Hosted and BYOC
        • Organization Statuses
        • Organization Roles & Permissions
        • Organization Dashboard
        • Organization Entities
      • Networks
        • Network Statuses
        • Network Roles & Permissions
        • Network Configurations
        • Mandatory Card Addition
        • Nodes: Peer, Orderer & CA
        • Network Hosting Type
        • Network Dashboard
        • Network Operations
        • Nodes
      • Channels
      • Apps
        • Pre-Configured Apps
        • Custom Apps
      • Asset Tokenization
        • Use cases
        • Asset types
        • References
        • Asset Owners
        • Permissions
      • Tokens & Vault
      • Listeners
        • Network Listeners
        • App Listeners
        • Token Listeners
      • Workflow Builder
      • Oracles
      • GraphQL
      • Block Explorer
      • IPFS
      • Fabric Debug Plugin
    • 🔊Public Chain
      • Token Store
      • Tokenize Real World Assets
      • Tokenomics: Token & Token Sale
      • Trade & Payout
  • How to
    • 🎧Private Network
      • Account
        • Create an Account
        • Edit Profile details
        • Update email & Password
        • Forgot password
        • Google OAuth Signup - Update Email & Password
        • Deactivating or deleting your account?
      • Organizations
        • Create an Organization
        • Create & Manage BYOC Hosting
        • Invite members to an organisation
        • Edit Organization details
        • Manage Org members
        • Leave an Organization
        • Update Organization member roles
        • Pay Organisation Invoice
        • Update Billing Address
        • View Invoices
        • Organization Dashboard
        • Delete an Organisation
      • Networks
        • Create a Network
        • Advance Settings: Key Vault Store
        • View and edit Network details
          • Update Permissions for Network Members
          • Update Network Configuration
          • Update Key Vault
          • Manage API Keys
          • Delete a network
        • Inviting an organisation to a Network
        • Network Roles & Permissions
        • Joining a Network
        • Network Dashboard
      • Apps
        • Explore Apps
        • Deploy App
          • Deploying Asset Tokenization App
        • Manage Apps
        • Application Dashboard
      • Channels
        • Creating a Channel
        • Create a Consensus Policy
        • Update Channel
        • Channel Members
        • Delete channel
      • Nodes
        • Create Node
        • Node Dashboard
        • Delete Node
      • Pre-configured Apps
        • Deploy Asset Tokenization App
        • Asset Data
      • Custom Apps
        • Deploy Custom Chaincode
        • Chaincode as external service
        • Supported File Formats - ZIP format
        • Building in Binary format
          • Golang - Binary Format
          • Java Jar files
        • Chaincode Logs
      • Workflow
        • Triggers
        • Condition
        • Read
        • Actions
        • End
        • Variables & Identifiers
        • Calculations & Formulas
      • Oracles
        • Create an Oracle
        • Oracle with Asset tokenisation
        • Oracle with Custom Chaincode
      • Listeners
        • Create a Listener
        • Manage Listeners
    • 🔊Public Chain
      • Account
        • Create an Account
        • Edit Profile details
        • Update email & Password
        • Forgot password
        • Google OAuth Signup - Update Email & Password
        • Deactivating or deleting your account?
      • Token Store
        • Create a Token Store
        • Design Store Front
        • Custom Domain Hosting
        • Google Analytics Integration
        • Create & Manage Store Users
          • Store User KYC
        • Accreditation Management
        • Store Payments
        • Token Store Customers
      • Tokenise a Real World Asset
        • Real Estate
        • Other Asset Categories
      • Create a token
        • Define your token
        • Investor & Buyback Settings
        • Configure token returns & payouts
        • Create token sale
      • Additional Configurations
        • Create a Document Workflow
      • Publish Asset
      • Tokenise on TestNet
        • Polygon Amoy
      • Manage Token lifecycle
        • Returns & Payouts
          • Initiate an equity payout
          • Authorise Debt Payouts
          • View all payouts
        • View token investors
        • View token transactions
        • View signed documents
        • View/ Create a token sale
        • Post Token Updates
        • Update Price
        • Buyback Requests
  • Billing & Pricing
    • Pricing
    • Billing
      • Opt-in Billing
      • Opt-out Billing
    • Adding a Card & Autopay
    • Invoice Payments
    • Billing forecast
    • Unpaid Invoices
    • Credits
  • Developers
    • API Reference
      • Asset Tokenization
        • REST API
        • Testing REST API
        • GraphQL
          • Quickstart
          • Simple queries
          • Nested object queries
          • Complex queries
          • Aggregate queries
          • Operators
          • Built-in attributes
          • Pagination
      • Custom Chaincode
        • REST API
        • Testing REST API
        • GraphQL
          • Quickstart
          • Simple queries
          • Complex queries
          • Operators
          • Pagination
      • Token Store (Public Chain)
        • Token Issuer
        • Investor
      • IPFS
    • Developer Tools
      • Monitoring [Coming Soon]
    • API Key
  • Support
    • FAQs
    • My account is banned [D]
    • Why is it recommended to have an Odd number of Orderer nodes on a Network?
    • Support
  • Others
    • Glossary
  • Policies
    • Terms & Conditions
    • Privacy Policies
    • Open Spydra
Powered by GitBook
On this page
  • Asset Actions
  • Tokens

Was this helpful?

  1. How to
  2. Private Network
  3. Workflow

Actions

PreviousReadNextEnd

Last updated 1 year ago

Was this helpful?

Asset Actions

Raise Event

Raise event action enables you to receive notifications when a specific event occurs. To define a raise event action, simply specify the event name, message, and optional data that you wish to be notified about.

Read How to set up app listeners App Listeners

For example, an insurance company wants to raise an event whenever a new insurance policy is issued to its customer.

Please make sure that app listeners are set up for the app you are setting the Workflow and "Workflow Event" is selected under events in order for the workflow to function correctly.

1. Create Asset

Create Asset action generates a new asset record on the blockchain. To define a Create Asset action, specify the asset type, along with any optional data for the asset as properties.

For example, an insurance company wants to create a user asset whenever an insurance asset is created for that user with data.

2. Update asset

The ‘Update Asset’ action will replace the current data of an existing asset with newly defined data.

Suppose, an insurance firm aims to modify the complete set of insurance information in response to a user's inquiry subsequent to the establishment of the insurance coverage. For example, in the event that a user decides to cancel their policy, the insurance company will remove the user. Simultaneously, insurance company can update whole insurance object with the data given in the "update asset" action block.

3. Update Asset Property

An action that modifies or updates specific properties or attributes of an existing asset. To define an update asset property action, specify the asset type, and the property key that you would like to update, along with the new value.

Suppose, an insurance holder wants to update his/her name as correction, the same should be updated in the user database of the insurance as well. Then, we can use the update asset property to update the user asset also in the same workflow.

4. Delete asset

An action that removes or deletes an existing asset. To define the delete asset, specify the asset type and ID to be deleted.

  • Asset ID can be variable using Variables & Identifiers like '$currentitem.data.userid}

  • Asset ID can also be a fixed id 'efjhl93283274'

For example, if insurance is expired or the user wants to discontinue the policy, an insurer can delete the insurance asset along with user asset.

5. Update Asset Owner

An action that updates owner of a particular asset. To define the update owner action, specify the

  • asset type

  • asset ID either variable or fixed ID

  • owners organisation

  • owner user ID (optional)

Owner can be either an organization or a specific user within an organization. Specific users can be defined by adding their key-value identifier. If user ID (optional field) is not added, the owner will be the selected organisation.

For example, when a car is manufactured, the organization which manufactured the car will be the owner of that car, but when a dealer sells the car to the end user, then the ownership of that car (asset) gets transferred to a customer.

6. Update Current Asset

Update Current Asset action will only update the trigger asset for the workflow under which it is defined. To define the action, specify the data that needs to be updated on the trigger asset.

It is similar to "update Asset Property" action, but in "update current asset" action, it updates the field only on the asset on which the triggered workflow is running.

For example, a workflow is defined as when a patient is admitted to the hospital, the hospital as an organization creates a patient asset. While creating the patient asset if they want to update the room number and ward based on conditions in the given input like if the patient's gender is male, then update the "ward" field of the asset to the value "male ward", then "update current asset" action can be used.

Please note that if the workflow trigger is set to "Approval Action," this action will not work.


Approval

1. Create Approval

An approval action can be created in a workflow to allow the workflow to branch based on approval conditions such as approved, rejected, and cancelled.

To create an approval action, specify the

  • Approvers- Approvers can be either an organization or specific users within an organization. Specific users can be defined by adding their key-value identifier. If user ID (optional field) is not added, the approval will be an organisation.

  • Approver count- The minimum number of approvers required for the status to turn to APPROVED.

  • Timeout- The time, in minutes, from the approval request after which the approval status will turn to CANCELLED.

  • Data- Optional data that can be utilized in steps after approval.

For example, a car is sold to a customer only after an approval action of governing body approves it.

Fetch external data (oracle)

An action that activates an oracle to retrieve external data for use in subsequent tasks or processes.

To create an oracle action block, specify the

  • Arguments- the arguments depend on the param type of the selected oracle source URL.

What is 'Do not trigger workflows' field?

The 'Do not trigger workflows' field is applicable for actions like- create asset, update asset, update asset property, delete asset, update owner.

If this field is checked, no other workflow will be triggered upon execution of this action. For instance, if this field is checked for a create asset action with asset type = insurance in workflow A, and workflow B has a trigger on create asset with asset type = insurance, workflow B will not be triggered if this field is checked.


Tokens

1. Mint

The Mint Token action is used to create new tokens. To define a Mint Token action, specify the token type, amount, the account to which the tokens will be minted, and any optional data.

If the token type is a non-fungible token (NFT), you also need to provide the asset ID.

2. Burn

The Burn Token action is used to destroy or remove tokens from circulation. No new tokens can be created after burning.

3. Transfer

The Transfer Token action is used to transfer tokens from one account to another. To define a Transfer Token action, specify the token type, amount, the account from which the tokens will be transferred, the account to which the tokens will be transferred, and any optional data.

A created approval can be used as a trigger for another workflow.

🎧
#5.-approval-action