"event" CTO Statement Syntax

Q

What is the syntax of the "event" CTO Statement?

✍: FYIcenter.com

A

The "event" statement declares the output message structure of an event type, which can be emitted from the business network for external systems to consume. Here is the syntax of an "event" statement:

event 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 "event" 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=/.../]".

 

"concept" CTO Statement Syntax

"transaction" CTO Statement Syntax

Business Network CTO Modeling Language

⇑⇑ Hyperledger Composer Tutorials

2019-04-24, 248👍, 0💬