Document creation

In this section we show the main concepts of agreement documents creation.

Step 1

First of all, you need to declare and initialize an AgreementManager:

AgreementManager manager = new AgreementManager();                                    
                                            
Step 2

You can pass a configuration file to the manager as a parameter. This file has to be written in JSON format:

{
    "defaultInputFormat": "IAGREE",
    "CSPReasoner": "CPLEX",
    "CSPWebReasonerEndpoint": "http://150.214.188.130:8080/CSPWebReasoner",
    "DLReasoner": "none",
    "ANDConstraintsBreaking" : "true" 
                                            
Step 3

To create a template, an offer or an agreement, use the manager as follow:

AgreementModel model = manager.createAgreementTemplate("Template's content");
AgreementModel model = manager.createAgreementOffer("Offer's content");
AgreementModel model = manager.createAgreement("Agreement's content");
                                            
Step 4

To create a template, an offer or an agreement from a file, use these methods instead:

AgreementModel model = manager.createAgreementTemplateFromFile("path/to/file.at");
AgreementModel model = manager.createAgreementOfferFromFile("path/to/file.ao");
AgreementModel model = manager.createAgreementFromFile("path/to/file.ag");
                                            
AgreementModel is a superclass that contains the following subclasses: AgreementTemplate, AgreementOffer and Agreement. We can cast our model to one of these three types depending on our case.