Hello World State

Author: Accord Project

helloworldstate@0.15.0 Clause ^0.22.0 f669a708b63c87e98b058592dff0b76ed62c0ddb5cb24d26b8a1a3b2d335c925

This is the stateful Hello World of Accord Project Templates. Executing the clause will simply echo back the text that occurs after the string `Hello` prepended to text that is passed in the request along with the number of times the clause has been called.

Download Archive Download Compiled Archive Open in Template Studio Open in VSCode Web

Hello World State

This is the stateful Hello World of Accord Project Templates. Executing the clause will simply echo back the text that occurs after the string Hello prepended to text that is passed in the request along with the number of times the clause has been called.

Template Text

Name of the person to greet: "Fred Blogs". Thank you!

Name of the person to greet: "Fred Blogs".
Thank you!
Name of the person to greet: {{name}}.
Thank you!
{
    "$class": "org.accordproject.helloworldstate.HelloWorldClause",
    "name": "Fred Blogs",
    "clauseId": "c1a6cbf4-c678-4e2c-9247-e8da60fb1eb5",
    "$identifier": "c1a6cbf4-c678-4e2c-9247-e8da60fb1eb5"
}

Template Model

namespace org.accordproject.helloworldstate

import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto

transaction MyRequest extends Request {
  o String input
}

transaction MyResponse extends Response {
  o String output
}

asset HelloWorldState extends State {
  o Double counter
}

/**
 * The template model
 */
asset HelloWorldClause extends Clause {
  /**
   * The name for the clause
   */
  o String name
}

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.helloworldstate.HelloWorldState
{
    "$class": "org.accordproject.helloworldstate.HelloWorldState",
    "counter": 181.191,
    "$identifier": "7f1c01d0-a77b-11eb-9770-7ddd576a12c2"
}

Request Types

Type Sample JSON
org.accordproject.helloworldstate.MyRequest
{
    "$class": "org.accordproject.helloworldstate.MyRequest",
    "input": "Esse labore.",
    "$timestamp": "2021-04-27T13:10:42.028-04:00"
}

Response Types

Type Sample JSON
org.accordproject.helloworldstate.MyResponse
{
    "$class": "org.accordproject.helloworldstate.MyResponse",
    "output": "Est.",
    "$timestamp": "2021-04-27T13:10:42.029-04:00"
}

Events Types

Type Sample JSON
concerto.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

Please refer to the Accord Project documentation for how to use a template or integrate it within your application.

View the Latest code for this template on GitHub.