Hello World State

Author: Accord Project

helloworldstate@0.13.1 Clause ^0.20.10 54cf344a57a72a769e68239ea25112f312b639c5fb4494605abe5a971b36db22

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 Open in Template Studio

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",
    "clauseId": "aa7ed115-67dc-42a1-8707-87b0d6378376",
    "name": "Fred Blogs"
}

Template Model

namespace org.accordproject.helloworldstate

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

transaction MyRequest extends Request {
  o String input
}

transaction MyResponse extends Response {
  o String output
}

asset HelloWorldState extends AccordContractState {
  o Double counter
}

/**
 * The template model
 */
asset HelloWorldClause extends AccordClause {
  /**
   * 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": 239.875,
    "stateId": "e4d9af51-7b6b-11ea-b280-c173749a9e96"
}

Request Types

Type Sample JSON
org.accordproject.helloworldstate.MyRequest
{
    "$class": "org.accordproject.helloworldstate.MyRequest",
    "input": "Dolore excepteur amet voluptate.",
    "transactionId": "e4d98840-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:11.940-04:00"
}

Response Types

Type Sample JSON
org.accordproject.helloworldstate.MyResponse
{
    "$class": "org.accordproject.helloworldstate.MyResponse",
    "output": "Ex duis.",
    "transactionId": "e4d9af50-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:11.941-04:00"
}

Events Types

Type Sample JSON
org.accordproject.base.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

Please refer to the Cicero documentation for details and examples of how to integrate a call to a Cicero template into your application.

View the Latest code for this template on GitHub.