Cicero 0.21 to 0.22
The main change between the 0.21 release and the 0.22 release is the switch to version 1.0 of the Concerto modeling language and library. This change comes along with a complete revision for the Accord Project "base models" which define key types for: clause and contract data, parties, obligations and requests / responses. We encourage developers to get familiarized with the new base models before switching to Cicero 0.22.
note
Before following those migration instructions, make sure to first install version 0.22 of Cicero, as described in the Install Cicero Section of this documentation.
Metadata Changes
You should only have to update the Cicero version in the package.json for your template to ^0.22.0. Remember to also increment the version number for the template itself.
Example
After those changes, the accordproject field in your package.json should look as follows (with the template field being either clause or contract depending on the template):
...
    "accordproject": {
        "template": "clause",
        "cicero": "^0.22.0"
    }
...
Text Changes
There should be no text changes required for this version.
Model Changes
Most templates will require changes to the model and should be re-written against the new base Accord Project models. Most of the changes should be renaming for key classes:
- Contract and Clause data
- the org.accordproject.cicero.contract.AccordContractclass is noworg.accordproject.contract.Contractfound in https://models.accordproject.org/accordproject/contract.cto
- the org.accordproject.cicero.contract.AccordClauseclass is noworg.accordproject.contract.Clausefound in https://models.accordproject.org/accordproject/contract.cto
 
- the 
- Contract state and parties
- the org.accordproject.cicero.contract.AccordStateclass is noworg.accordproject.runtime.Statefound in https://models.accordproject.org/accordproject/runtime.cto
- the org.accordproject.cicero.contract.AccordPartyclass is noworg.accordproject.party.Partyfound in https://models.accordproject.org/accordproject/party.cto
 
- the 
- Request and response
- the org.accordproject.cicero.runtime.Requestclass is noworg.accordproject.runtime.Requestfound in https://models.accordproject.org/accordproject/runtime.cto
- the org.accordproject.cicero.runtime.Responseclass is noworg.accordproject.runtime.Responsefound in https://models.accordproject.org/accordproject/runtime.cto
 
- the 
- Predefined obligations have been moved to their own model file found in https://models.accordproject.org/accordproject/obligation.cto
warning
Some of the properties in those base classes have changed, e.g., the contract state no longer requires a stateId. As a result, corresponding changes to the contract logic in Ergo or to the application code may be required.
Example
A typical change to a template model might look as follows, from:
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
/**
 * Defines the data model for the Purchase Order Failure
 * template.
 */
asset PurchaseOrderFailure extends AccordContract {
  o AccordParty buyer
  ...
}
To:
import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto
import org.accordproject.party.* from https://models.accordproject.org/accordproject/party.cto
import org.accordproject.obligation.* from https://models.accordproject.org/accordproject/obligation.cto
asset PurchaseOrderFailure extends Contract {
  --> Party buyer
  ...
}
Logic Changes
Minimal changes to the contract logic should be required, however a few changes to the base models may affect your Ergo code. Notably:
- You should import the new Accord Project core models as needed
- The contract state no longer requires a stateIdfield.
- The base contract state has been moved to the runtime model, which may need to be imported
API Changes
A number of API changes may affect Node.js applications using Cicero or Ergo packages. The main API changes are:
- Additional utcOffsetparameter.- @accordproject/cicero-corepackage- the TemplateInstance.parseandTemplateInstance.draftcalls take an additionalutcOffsetparameter to specify the current timezone offset
 
- the 
- @accordproject/cicero-enginepackage- the Engine.init,Engine.invokeandEngine.triggercalls take an additionalutcOffsetparameter to specify the current timezone offset
 
- the 
- @accordproject/ergo-enginepackage- the Engine.init,Engine.invokeandEngine.triggercalls take an additionalutcOffsetparameter to specify the current timezone offset
 
- the 
 
- New es6compilation target for Ergo.- @accordproject/ergo-compilerpackage- the Compiler.compileToJavaScriptcompilation targetcicerohas been renamed toes6
 
- the 
- @accordproject/cicero-corepackage- the Template.toArchivecompilation targetcicerohas been renamed toes6
 
- the 
 
CLI Changes
- Specific UTC timezone offset now needs to be passed using the new option --utcOffsetoption has been removed
Cicero Server Changes
There should be no text changes required for this version.