rev 1.0 - 05/2010
Contents
Introduction
Project Contents
Development
Building & Deploying
About Active Endpoints

Claim Processing Demo - Client Design Guide

Introduction

This document will explain how the Claim Request client web page of the Claims Processing Sample Application  was designed and implemented using process request forms generated from the ClaimsProcessing schema using ActiveVOS Designer. Here is an image showing the page that will be described:

The actual web application consists of additional pages and resources which are described in the Project Contents section below. 

Development Steps Outline

Here is an outline of the steps that were used to build the claim processing request (claimRequest.html) page:


Project Contents

The complete project for this client is located in the AVClaimClient folder and contains the following files:

 
Name
Description
.project Eclipse project file
build.xml
Apache Ant build script
AVClaimClient.war
Project contents bundled as standard J2EE Web Application
OriginalRequestForms The Process Request Forms that were used as the basis for this project
WebContent
Folder containing the  html web pages, CSS stylesheets & the required JavaScript libraries
          css Contains the CSS resources used by the generated forms
          images Contains the image files used in the web pages
          js Contains the JavaScript resources used by the generated forms
          META-INF Contains manifest.mf file required for J2EE Web Application
          WEB-INF Contains web.xml file required for J2EE Web Application


Development

Generate the Process Request Forms

The process request forms were generated in ActiveVOS Designer using the schema definition for the claim process WSDL interface.  Copies of the original forms are located in the OriginalRequestForms folder of this project.  For a quick look at the changes you can compare the files in this folder against the modified versions of the same files which are located in the WebContent folder.

Modify the generated forms

1.  Replace $ID with _ID in the generated form

The $ID suffix is used in HTML element names, attributes or in JavaScript are replaced with a unique string (an integer for Request forms, and taskID for Task forms) when the form is rendered by ActiveVOS Central.  Since we don't need this feature in our externalized version of the process request form, and the $ string is not a valid character for an <id> attribute we will change the $ to and underscore character.

2.  Import ActiveVOS Central resources

The forms generated expect certain ActiveVOS Central resources to be available at runtime. In ActiveVOS Central these resources are included in the activevos-central.war file.  We're going to import these resources directly into the forms.

The resource files and folders were copied from the avc-res folder in the activevos-central.war into the WebContent folder of the project and the following lines were added to the <head> section of the web page:
<script type="text/javascript">
// Path to where images, script files, css etc. are stored.
AE_RESOURCE_BASE = "";
// animated 'loading' image
AE_AJAX_IMAGE_SRC = "images/ajax-loader.gif";
// transparent 1px X 1px image.
AE_1X1_IMAGE_SRC = "images/trans1x1.gif";
// Current locale, country and lanuage
AE_ACTIVEVOS_I18N_LOCALE = "en_US";
AE_ACTIVEVOS_I18N_LANGUAGE = "en";
AE_ACTIVEVOS_I18N_COUNTRY = "US";
</script>

<!-- Stylesheet references from jquery and for avc -->
<link type="text/css" href="css/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<link type="text/css" href="css/dataTables/jquery.dataTables.css" rel="stylesheet" />
<link type="text/css" href="css/timeentry/jquery.timeentry.css" rel="stylesheet" />
<link type="text/css" href="css/ae-avc-app-icons-sprite.css" rel="stylesheet" />
<link type="text/css" href="css/ae-avc-task-ops-sprite.css" rel="stylesheet" />
<link type="text/css" href="css/ae-avc-file-types-sprite.css" rel="stylesheet" />
<link type="text/css" href="css/ae-avc.css" rel="stylesheet" />

<!-- Stylesheet for this app with overrides to the jquery and avc standard
stylesheets -->
<link href="master.css" rel="stylesheet" type="text/css">

<!-- Scripts for jquery and plugins -->
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/KeyTable.min.js"></script>
<script type="text/javascript" src="js/jquery.i18n.properties-1.0.4-min.js"></script>
<script type="text/javascript" src="js/date.js"></script>
<script type="text/javascript" src="js/jquery.viewport.js"></script>
<script type="text/javascript" src="js/jquery.delay.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.timeentry.js"></script>
<script type="text/javascript" src="js/additional-methods.js"></script>

<!-- Common AVC scripts -->
<script type="text/javascript" src="js/ae-avc-util.js"></script>
<script type="text/javascript" src="js/ae-avc-ui.js"></script>
<script type="text/javascript" src="js/ae-avc-requests.js"></script>
<script type="text/javascript" src="js/ae-avc-tasks.js"></script>

<script type="text/javascript">
// define engine url
AE_ACTIVEVOS_ENGINE_URL = "http://localhost:8080/active-bpel";
</script>

3.  Update the form to handle attachments

Note: Applicable to ActiveVOS 7.1.2 or later.

In order to support attachments in process request forms the following changes must be made to the form.

a. Find the input tag and change it to specify POST as the method and multipart/form-data as the enctype.

    Change from:

 <form id="requestInputForm$ID" name="requestInputForm$ID" action="">

     to use POST method and multipart/form-data enctype:

<form id="requestInputForm_ID" name="requestInputForm_ID" action="" method="post" enctype="multipart/form-data">


b. On the next line directly below the updated <form> tag add the following hidden input fields:

<input type="hidden" name="_json" value="" class="_json_ID" />
<input type="hidden" name="responseContentType" value="text/html" />
<input type="hidden" name="responseWrap" value="textarea" />

c. Modify  the HTML control for file upload within the HTML form.

    Change from:

<input id="iURL1_ID" name="URL" value="" size="25" type="file" class="avc_data_field_ns_claimRequest_ns_links_ns_link_ns_URL " onclick="return iURL1_ID_onclick()" />

     
       to:

<input id="iURL1_ID" name="URL" value="" size="25" type="file" class="avc_data_field_ns_claimRequest_ns_links_ns_link_ns_URL avc_required_field" />

d.  Move the submit button which currently is located outside of the <form> tags into the form so that it is before </form>.


e.  Change the type of the submit button from type='button' to type='submit'.

<input type="submit" id="sendRequest_ID" value="Send Request" class="avc_form_instance_save" /> 

f.  Delete the following two lines of JavaScript from the documentReady function:

// Assign handler for saving form data entered by the user
$("#sendRequest_ID").click(_submitRequest);

g.  Add the following JavaScript to the documentReady function.

$('#requestInputForm_ID').submit(function() {
requestForm.submitRequest();
// Important always return false to prevent standard browser submit and page navigation
return false;
});

h.  Replace the following JavaScript in _submitRequest() function:

AE_AJAX_SERVICE_UTIL.postJSON(url, request, _showResponseCallback, _showFaultCallback, _communicationErrorCallback);

    

     with:

var _error = function(xhr, status, errorThrown) {
_showFaultCallback(errorThrown);
};

var jsonString = JSON.stringify(request);
$("._json_ID").val(jsonString);

var options = {
dataType : 'json',
url: url,
success: _showResponseCallback,
error: _error
};
$("#requestInputForm_ID").ajaxSubmit(options);

Note that when using this methodology (with the jQuery Forms plugin), the success callback function is used for both - success and faults. Your code in the success callback function should examine the JSON result to determine if the response is a fault.

The design of the claimStatus page is handled in the same fashion, except it does not require the additional code to process attachments.  Once you have your pages written the next step is to deploy them which is described next.

Building & Deploying

Included in the root folder of the project is an Apache Ant build.xml file that is used to create a standard J2EE Web Archive file that can be deployed as a standard web application. 

To create the web archive:

To deploy the web application on Tomcat:


Once the client web application is deployed you can use it to run through the demo scenario.  The User Guide in the docs folder of the Claims Processing Sample Application describes how to run the demo.


About Active Endpoints

Active Endpoints (www.activevos.com) is the leading developer of visual orchestration systems. ActiveVOS empowers line of business project teams to create applications using services and industry standards, making their businesses more agile and effective. Active Endpoints ActiveVOS promotes mass adoption of SOA-enabled applications by focusing on accelerating project delivery time with a standards-based, easy to use system. Active Endpoints is headquartered in Waltham, MA with development facilities in Shelton, CT.

To find out how Active Endpoints can help your business, visit www.activevos.com, call +1 781 547 2948, or email us at info@activevos.com.