Namespace org.accordproject.cicero.runtime@0.2.0

Compatible with Concerto versions ^3.0.0. Has 9 declarations.

Concerto JSON AST UML JSON Schema XML Schema GraphQL TypeScript CSharp Java Go OData

Declared Types

      
      import org.accordproject.cicero.runtime@0.2.0.Request from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.Response from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.ErrorResponse from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.Obligation from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.PaymentObligation from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.NotificationObligation from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.Payload from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.Success from /cicero/runtime@0.2.0.cto
      import org.accordproject.cicero.runtime@0.2.0.Failure from /cicero/runtime@0.2.0.cto
      
      

Dependencies

Source

    /*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

concerto version "^3.0.0"
namespace org.accordproject.cicero.runtime@0.2.0

import org.accordproject.cicero.contract@0.2.0.{AccordContract, AccordContractState} from https://models.accordproject.org/cicero/contract@0.2.0.cto
import org.accordproject.money@0.3.0.MonetaryAmount from https://models.accordproject.org/money@0.3.0.cto

/**
 * Contract API
 * -- Describes input and output of calls to a contract's clause
 */

/* A request is a transaction */
transaction Request {}

/* A response is a transaction */
transaction Response {}

/* An Error is a transaction */
abstract transaction ErrorResponse {}

/* An event that represents an obligation that needs to be fulfilled */
abstract event Obligation {
  /* A back reference to the governing contract that emitted this obligation */
  --> AccordContract contract

  /* The party that is obligated */
  --> Participant promisor optional // TODO make this mandatory once proper party support is in place

  /* The party that receives the performance */
  --> Participant promisee optional // TODO make this mandatory once proper party support is in place

  /* The time before which the obligation is fulfilled */
  o DateTime deadline optional
}

event PaymentObligation extends Obligation{
  o MonetaryAmount amount
  o String description
}

event NotificationObligation extends Obligation {
  o String title
  o String message
}

/* A payload has contract data, a request and a state */
concept Payload {
  o AccordContract contract  // the contract data
  o Request request
  o AccordContractState state optional
}

/* If the call to a contract's clause succeeds, it returns a response, a list of events and a new state */
concept Success {
  o Response response
  o AccordContractState state
  o Event[] emit
}
/* If the call to a contract's clause fails, it returns and error */ 
concept Failure {
  o ErrorResponse error
}

/**
 * The functional signature for a contract call is as follows:
 * clausecall : String contractName -> String clauseName -> Payload payload -> Success | Failure
 */