"transaction" CTO Statement Syntax

Q

What is the syntax of the "transaction" CTO Statement

✍: FYIcenter.com

A

The "transaction" statement declares the input message structure of a transaction type, which can be submitted to the business network for processing. Here is the syntax of an "transaction" statement:

transaction type_name [extends super_type] {
  o|--> property_type property_name [optional] [default value] [validator]
  ...
  o|--> property_type[] property_name [optional]
  ...
} 

Syntax elements used in a "transaction" CTO Statement:

  • "type_name" - A required field to specify the name for this data type.
  • "extends super_type" - An optional field to specify the super "transaction" type, if this data type is an extension data type.
  • "o" - A required flag to specify a value property for this data type.
  • "-->" - A required flag to specify a reference property for this data type.
  • "property_type" - A required field to specify the data type of this property.
  • "[]" An optional flag to indicate that this property is an array.
  • "property_name" - A required field to specify the name of this property.
  • "optional" - An optional flag to indicate that this property is not required.
  • "default value" - An optional field to specify a default value for this property.
  • "validator" An optional field to specify a specify a validation rule like "range=[...]" or "[regex=/.../]".

 

⇒ "event" CTO Statement Syntax

⇐ "asset" CTO Statement Syntax

⇑ Business Network CTO Modeling Language

⇑⇑ Hyperledger Composer Tutorials

2021-08-01, 825🔥, 0💬