Document Generator - Sample Code (TxtDocumentGenerator)

The most common implementations of Document Generator plugins are for:

 

The Document Generator in this example does the following:

 

The sample code will cover the following:

Setup

This sample code needs the following to run:

About the Document Generation Rulebase:

About the TxtDocumentGenerator plugin:

About the SaveTxtDocument Event Handler:

To setup this scenario:

  1. Create the Rulebase in Oracle Policy Modeling, and run Build
  2. Copy the rulebase .zip file from the project output directory (for example, C:\projects\TxtDocumentGenerator\Development\output) to the rulebase folder in Web Determinations (for example, <webroot>\WEB-INF\classes\rulebase)
  3. Copy the code for the TxtDocumentGenerator plugin
  4. Compile and JAR the TxtDocumentGenerator
  5. Install the JAR file on the Web Determinations; for more information, see the topic: Create a Plugin
  6. Run a Web Determinations Interview

How the TxtDocumentGenerator works

The TxtDocumentGenerator is triggered to generate .txt documents from two sources:

 

As noted in the Setup section above, the document links are only displayed once the goal attribute 'tickets' is reached. Similarly, the SaveTxtDocument Event Handler will only call for a TXT document to be generated once the goal attribute 'tickets' is reached.

 

TxtDocumentGenerator.java

 

SaveTxtDocument.java