IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

Creating a JXFS Service

About this task

The following section describes how to create a JXFS Service instance using the JXFS Check Reader Service as an example.

To create a JXFS Service, do the following:

Procedure

  1. Create a class by extending JXFSService, which in turn extends the Service class. The Service class provides the ability to define parameters externally in an XML file, the ability to integrate with other components, especially with context data, and generate events in addition to JavaBean events. Services are placed in a given context and can use formats to access context data.
  2. In the new JXFS Service class, create variables to hold the attributes of the service. For example, the JXFS Check Reader service has the following attributes:
    • Simple check reader:
      • String checkData; // Data read from a check
      • Byte [] checkImage; // Image of a check
    • Complex check reader:
      • Boolean stampFront; // To stamp the front of the check
      • Boolean stampBack; // To stamp the back of the check
      • Boolean endorseFront; // To endorse the front
      • Boolean endorseBack; // To endorse the back
      • Int stampX; // The horizontal position for stamping
      • Int stampY; // The vertical position for stamping
      • Int pocket; // The destination pocket
      • String encodeData; // The data to be encoded
      • String encodeFont; // The font to be used when encoding
      • String endorseFont; // The data for endorsement
  3. Create getters and setters for the new attributes. A simple check reader, for example, can only read information so it is not necessary to set many attributes. A complex check reader can do more than read, so you need to implement the getters and setters.
  4. Override the initializeFrom(Tag) method.
  5. Define the service in the service definition file and externalize the attributes such as simple check reader getImage attribute or all of the complex check reader attributes in the definition.
  6. In the new class, override the toString() method.
  7. Define the tagName - className relationship in the services section of the configuration file (dse.ini) as follows:
    <kColl id="services">
        ... 
       <field id="JXFSChk"
        value="com.ibm.dse.services.jxfs.chk.JXFSChk"/>
  8. Add operations to support the service functionality such as the following check reader operations:
    • ReadDataSync: a synchronous operation that reads data from check.
    • ReadDataAndUnformatSync: a synchronous operation that reads data from check and updates the context with the results
    • ProcessCheckSync: a synchronous operation that processes a check.
    • ProcessCheckAndFormatSync: a synchronous operation that processes a check using encodeData and endorseData from the context.


Feedback