Derived documents

In this section we show how to generate offers and agreements from other files.

Generating offers from templates

Step 1

Generate an offer from a template is as easy as use the method generateAgreementOffer from the type AgreementTemplate.

AgreementTemplate myTemplate = manager.createAgreementTemplateFromFile("path/to/file.at");
AgreementOffer myOffer = myTemplate.generateAgreementOffer("Consumer name");
                                            

Generating agreements from offers

Step 2

In the same way, we can generate an agreement from an offer using the method generateAgreement:

AgreementOffer myOffer = manager.createAgreementOfferFromFile("path/to/file.ao");
Agreement myAgreement = myOffer.generateAgreement("Consumer name");