Retrieving documents

In this section we show how to save and retrieve documents from AML.

Saving documents

Step 1

Note that when we create models, we are not registering it. So if we need to use it later, we won't be able to retrieve it.If you want that a model persists, you should use register methods.

manager.register(model);

In this case, you'll be able to retrieve your model specifying its ID. If you prefer to specify a custom name, use the following method instead:

manager.register("MyModel", model);

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

manager.registerFromFile(file); // file: File format
manager.registerFromFile("path/to/file");
                                            

Retrieving documents

Step 2

To retrieve a model, simply use one of these three methods, depending on your case:

manager.getAgreementTemplate("MyModel");
manager.getAgreementOffer("MyModel");
manager.getAgreement("MyModel");