NOTE: Trivore ID Documentation has moved to https://trivoreid.com

The content on this site IS OUT OF DATE!

This space has been archived!

Please go ahead to the new site!

Contract Service (java)

List of all options:

  • Contracts management
  • Contract's Parties management
  • Party's Signers management
  • Party's Contacts management
  • Appendix management
  • Contract body's file management
  • Appendix file management

Contract Status

  • DRAFT - new contract has been created.
  • SIGNABLE - contract has been finalized. NB! Even if the allowed action modifyFinalised is True, after contract is finalized user can modify only notes.
  • SIGNED - every signer has signed.
  • EXPIRED - contract passes expiration dates.
  • TERMINATED - contract termination conditions are passed
  • ARCHIVED - expired or terminated contract will eventually be archived

Contract Actions

  • Finalize - to finalize contract following conditions should be fulfilled:
    • current user must have read access to contract
    • current user must be owner of contract
    • contract's state must be DRAFT
    • contract must have an owner
    • contract must have at least one party
    • each party must have at least one signer
  • Sign
  • Terminate

Initialize service

TrivoreID sdk = TrivoreID.openIdClient();
ContractServiceImpl contractService = new ContractServiceImpl(sdk.contractService());

Contracts management

// Get list of all contracts
Page<Contract> page = contractService.getAll();

// Apply filter
Filter filter = Filter.equal("id", contractId);
page = contractService.getAll(new Criteria(filter));

// Add new Contract
Contract contract = new Contract();
contract.setValidFrom("2018-04-26T08:38:02.730Z");
contract.setValidTo("2022-04-26T08:38:02.730Z");
contract.setCode("exampleCode");
contract.getFinancialTerms().setBillingTerms("Example Billing Terms");

// This method returns new contract object with the generated ID
contract = contractService.create(contract);
String contractId = contract.getId();

// Get one and Update
contract = api.contract_service.get(contractId)

contract.setScope("modified scope");
contract.setTitle("Modified Title");
contractService.update(contract);

// Get all allowed actions, finalise, sign and terminate the contract

// returns dictionary with all actions
AllowedActions actions = contractService.getAllowedActions(contractId);

contractService.finalise(contractId);

contractService.sign(contractId);

contractService.terminate(contractId, "Example reason.");

// Delete
contractService.delete(contract);

Contract's Party management

// Get list of all contract's parties.
// Instead of Page returns list of parties. No pagination or filter can be applied.
List<Party> parties = contractService.getAllParties(contractId);

// Add new Party
Party party = new Party();

party.setName("Example Name");
party.setAddress("Example Address");

// This method returns new party object with the generated ID
party = contractService.createParty(contractId, party);
String partyId = party.getId();

// Get one, Update and Delete
party.setMobile("+358401234567");
party.setEmail("example@example.com");
contractService.updateParty(contractId, party);

party = contractService.getParty(contractId, partyId);
contractService.deleteParty(contractId, partyId);

Party's Signer management

// Get list of all contract's signers.
// Instead of Page returns list of signers. No pagination or filter can be applied.
List<Signer> signers = contractService.getAllPartySigners(contractId, partyId);

// Add new Signer
Signer signer = new Signer();

signer.setName("Example Name");
signer.setAddress("Example Address");

// This method returns new signer object with the generated ID
signer = contractService.createPartySigner(contractId, partyId, signer);
String signerId = signer.getId();

// Get one, Update and Delete
signer.setMobile("+358401234567");
signer.setEmail("example@example.com");

contractService.updatePartySigner(contractId, partyId, signer);

signer = contractService.getPartySigner(contractId, partyId, signerId);

contractService.deletePartySigner(contractId, partyId, signerId);

Party's Contact management

// Get list of all contract's contacts.
// Instead of Page returns list of contacts. No pagination or filter can be applied.
List<Contact> contacts = contractService.getAllPartyContacts(contractId, partyId);

// Add new Contact
Contact contact = new Contact();

contact.setName("Example Name");
contact.setAddress("Example Address");

// This method returns new contact object with the generated ID
contact = contractService.createPartyContact(contractId, partyId, contact);
String contactId = contact.getId();

// Get one, Update and Delete
contact.setMobile("+358401234567");
contact.setEmail("example@example.com");

contractService.updatePartyContact(contractId, partyId, contact);

contact = contractService.getPartyContact(contractId, partyId, contactId);

contractService.deletePartyContact(contractId, partyId, contactId);

Contract's Appendix management

// Get list of all contract's appendices.
// Instead of Page returns list of appendices. No pagination or filter can be applied.
List<Appendix> appendices = contractService.getAllAppendices(contractId);

// Add new Appendix
Appendix appendix = new Appendix();

appendix.setText("Example text.");
appendix.setTitle("Example Title");

// This method returns new appendix object with the generated ID
appendix = contractService.createAppendix(contractId, appendix);
appendixId = appendix.getId();

// Get one and Update
appendix.setText("Modified appendix text.");
contractService.updateAppendix(contractId, appendix);

appendix = contractService.getAppendix(contractId, appendixId);

// Change appendix order
contractService.changeAppendixOrder(contractId, iDsList);

// Delete
contractService.deleteAppendix(contractId, appendixId);

Contract Service Models

/wiki/spaces/TISpubdoc/pages/20515187

/wiki/spaces/TISpubdoc/pages/20515193

/wiki/spaces/TISpubdoc/pages/20515194

/wiki/spaces/TISpubdoc/pages/20515188

/wiki/spaces/TISpubdoc/pages/20515185

/wiki/spaces/TISpubdoc/pages/20515184

/wiki/spaces/TISpubdoc/pages/20515189

/wiki/spaces/TISpubdoc/pages/20515186

NOTE: Trivore ID Documentation has moved to https://trivoreid.com

The content on this site IS OUT OF DATE!

This space has been archived!