Use the Default Document Generator

Document Generators allow users to download and save a document with data from the Web Determinations interview. The document is usually a transcript of the interview for record keeping, but can be any document that requires data from the interview to be embedded in it, such as a pre-filled form.

The default Document Generator allows users to save and print a transcript of their Web Determinations interview in the following formats:

 

The general steps to enable a user to download a document for a Web Determinations interview are:

  1. Add a Document link to the Web Determinations interview (via Oracle Policy Modeling)
  2. Create the template for the document
  3. Deploy the template together with the rulebase to Web Determinations.

 

The main difference between the default Document Generator and a custom Document Generators is that the HTML and PDF formats supported by the default Document Generator requires template files.

Custom Document Generators can use template files (that is, the value entered by the user in the Template field), almost all cases would not require a template.

To use the default Document Generator make sure no other custom Document Generators are available. Custom Document Generators take precedence over the default Document Generator, so the default Document Generator will not be registered in the interview session if another custom Document Generator plugin exists and can be registered to the current Web Determinations interview.

Go to:

Add a Document link

Create a Template file

Add the required JAR file to generate PDF Documents

Use the Document links during the Web Determinations Interview

Troubleshooting

 

Add a Document link

Adding a Document link to the Web Determinations interview is performed during Screen authoring of a rulebase. When adding a Document link, the rulebase author is able to control:

 

The following screenshot displays the Screen Authoring window, and a view of the summary screen and a Document link selected:


Assumptions:

It is assumed that the rulebase author has already created the rules and attributes of the rulebase.

Definitions:

Add a Document Generation link to the interview

The rulebase author specifies what Decision Report/s are available, the file format of the transcript, and if applicable, the template to be used (which controls transcript layout and content)

To add a Document link, do the following:

  1. In the Screen Authoring window, open the Summary screen
  2. Add a new documentlink by clicking on the New Document button
  3. Provide a caption for the document link and the style. The caption will be the text for the transcript link.
  4. Set the Document Type (file format). Oracle Policy Modeling supports 2 of the 3 formats of the default Document Generator - HTML and PDF; to set the Document Type to XML, instead of using the dropdown, type XML into the field.
  5. If HTML or PDF was selected in the Document Type, provide the path location of the template file in Template field; note:
    1. The path is the relative path of the template file in the output folder.
    2. The template file is usually under a template folder
    3. An example value would be template/mytemplate.xs
    4. The HTML template file is written in XSL (http://www.w3schools.com/xsl/xsl_intro.asp)
    5. The PDF template file is written in XSL-FO (http://www.w3schools.com/xslfo/xslfo_intro.asp)
    6. For more information, see below in Create a Template File.

  6. Select one or more attributes as available Decision Reports in the document.

Control when the Document link is to be available

Availability of the Document link to the user is controlled by the Visibility area on the Summary screen. There are two fields in this area - Attribute and Default State. This area works identically to controlling the visibility of Goal links.

Create a Template file

Once a Document link for either HTML or PDF has been added, a template file needs to be created for the link to work.

The template file for HTML is the XML Stylesheet Language (XSL). The template file for the PDF is the XML Stylesheet Language - Formatted Objects (XSL-FO). The template should be located at the path entered in the Template field.

Template source document - XDS Format

The template source document is the interview data in XDS format - an XML format used in Oracle Policy Automation applications to represent the rulebase model and instance data.

Both XSL and XSL-FO templates are used in conjunction with the template source document. When the Document Generator plugin generates the document, it generates an XDS file, then 'transforms' the XDS XML file using the template file (XSL or XSL-FO) to generate the document for the user to download.

The XDS format is the format used by the default Data Adaptor plugin (XDS Data Adaptor) in Web Determinations for saving Web Determinations Interview data. The XDS format is also used in Oracle Policy Modeling to save Interview data (for example, when running Debug)

There are a number of ways to generate a sample XDS file for the current rulebase (which would greatly help during creation of the XSL/XSLFO template file); they are:

 

The following is a sample XDS; note the XML nodes, attributes, attribute and node values; it is possible to deduce some of the rulebase model data and instance data by analyising the sample XDS.

 

 

Build the Template File

The template file can only be constructed if the developer has good knowledge of the XDS structure (the XML nodes, hierarchy, node attributes), and familiarity with the rulebase model (and thus expected XML attribute and node values). having a sample XDS for the rulebase is highly recommended.

Notes:

Add the required JAR file to generate PDF Documents

A JAR file needs to be added to the Oracle Web Determinations library to be able to generate PDF documents. The JAR file will have the filename xml-apis-ext-X.X.XX.jar where the X denotes the version/major/minor release numbers; for example, "xml-apis-ext-1.3.04.jar".

Obtain the JAR file

The JAR file can be obtained as part of the Apache FOP (Formatting Object Printer) package. The website for Apache FOP is http://xmlgraphics.apache.org/fop/index.html

  1. Go to the Apache FOP website
  2. Go to the 'Downloads' section
  3. Download the Apache FOP package. It will come as either Binary or Source, we will be extracting the specific file from the package so download the format that you are comfortable with
  4. Once the Apache FOP package has been downloaded, find the specific JAR file.

Install the JAR file

Once the JAR file has been obtained, it needs to be installed into the OWD library

  1. Go to the Oracle Web Determinations webapp folder (for example, for a local Tomcat install, it would be C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\web-determinations
  2. Then go to the WEB-INF folder, then lib folder
  3. Copy/Move the JAR file into the lib folder

 

If you are still experiencing issues generating PDF documents, see Document Generation for PDF files

 

Use the Document links during the Web Determinations Interview

The user will be able to see a Document link in the Summary Screen once the Document link has been added in Oracle Policy Modeling Screen Authoring.


When the user clicks a document link, it will trigger the Document Generator plugin to generate an XDS for the current Interview, then generate the actual document using the template file. The Document Generator plugin will first attempt to locate the template file using the path provided in Template field of the Document link.

If the template file is not present (not deployed, incorrect path), an error will occur during document generation, and an error page will be displayed to the user.

Troubleshooting

Document Generation for PDF files

For issues with generating PDF transcripts, please ensure that the library files (JAR for Java and DLL for .NET) for FOP is present in the web application.

For Java (Apache Tomcat)

The 'lib' folder when running Web Determinations in Tomcat is in <Tomcat>\<web determinations app folder>\WEB-INF\lib

For example, for a default Tomcat installation in Windows - C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\web-determinations\WEB-INF\lib

Ensure the FOP library files below is present in the 'lib' folder:

For .NET (IIS)

The 'lib' folder when running Web Determinations in IIS is in <IIS>\<web determinations app folder>\bin

For example, C:\inetpub\web-determinations\bin

Ensure the nFOP library files below is present in the 'lib' folder: