Hello World

Author: Accord Project

helloworld@0.12.1 Clause ^0.20.10 3702b3c7e68754ce24200560ffb94ac3a2147c6b4a10c8c38dbaf1052223277d

This is the 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.

Download Archive Open in Template Studio

Hello World

This is the 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.

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.helloworld.HelloWorldClause",
    "clauseId": "f1a45b90-7bd5-411c-a499-01d7ec506030",
    "name": "Fred Blogs"
}

Template Model

namespace org.accordproject.helloworld

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
}

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

// this is a change!

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "e2eecf41-7b6b-11ea-b280-c173749a9e96"
}

Request Types

Type Sample JSON
org.accordproject.helloworld.MyRequest
{
    "$class": "org.accordproject.helloworld.MyRequest",
    "input": "Eiusmod nulla consequat ad duis.",
    "transactionId": "e2eea830-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:08.723-04:00"
}

Response Types

Type Sample JSON
org.accordproject.helloworld.MyResponse
{
    "$class": "org.accordproject.helloworld.MyResponse",
    "output": "Do.",
    "transactionId": "e2eecf40-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:08.724-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.