Skip to content

webTF User Guide

Overview

Web Transaction Framework (webTF) is a lightweight IBM i (formerly known as AS400, iSeries) component. It simplifies the implementation of outbound integrations (from IBM i to an external API) for companies that use MuleSoft, Confluent, or similar integration platforms.

Sample use cases

Real-time outbound API calls improve customer experience, process quality, and operational efficiency. For example:

  • Request a shipping quote and delivery date from multiple third-party logistics providers.
  • Run a real-time credit application check and get the FICO score and other credit rating and decision details directly into an IBM i application.
  • Check whether a customer already exists in a Customer Data Platform or CRM before creating the customer in the back-end application, to avoid duplicates.
  • Call an external tax calculation service for orders entered directly into the back-end system.

Product features

  • Automatically manages low-level communications with MuleSoft or similar platforms, with no API or data queue development required.
  • Extensible, developer-friendly framework built on the native IBM i stack.
  • Configuration and management of all outbound API integrations within the product UI.
  • Transaction tracking and exception logging details that can be streamed into log aggregation, alerting, and monitoring platforms such as Splunk or Elastic stack.
  • Offered as a free add-on to any other Infoview product.

How it works

webTF offloads all interaction with external APIs from IBM i to MuleSoft or a similar integration platform. The product communicates with the integration platform through a pair of data queues (DQ): one for requests and one for responses.

webTF places a new transaction (message) into the request DQ and then waits for a reply with the same transaction ID in the response DQ. The tool has basic timeout and retry functionality.

The IBM i developer only needs to configure the integration (referred to as a Transaction Type) and then call the standard webTF program CRTTRN or PRCTRN to create and process (send and receive) the transaction through the data queues.

IBM i requirements and considerations

  • The minimum supported OS release level is 7.1.
  • Although the product is a free add-on, it requires a valid license to operate. Contact the Infoview Sales team at sales@infoviewsystems.com to obtain the license key.

Installation

  1. Transfer the SAVF with the product to your IBM i.
  2. Restore the product library WTF400 into your system. The Infoview Customer Success team builds a save file that is already packaged with the license key for your serial numbers.

Product configuration

  1. Set up a new transaction type (outbound integration):

    ADDLIBLE WTF400
    
    CALL EDTTYPES
    

    Press F6 to create a new type, or use option 2 to edit an existing type. Set the following fields:

    Field Value or description
    Transaction Type Unique name, such as TimeCharges.
    Transaction Category Any string, for documentation only.
    Description Free-form field.
    Process Program PRCTRNDQ, the data queue processing program.
    Request Data Queue Name of the request data queue.
    Response Data Queue Name of the response data queue.
    Log Level Not used. Enter a value such as WARNING.
    Sync (Y/N) Not used. Set to Y.
    Time out Number of seconds to wait until the middleware picks up the entry.
    No of Retries Number of retries if the client does not pick up the entry or there is no response.
    Auto process on Create Y releases the transaction as soon as it is created. N only creates the transaction record. See below.

    Set Auto process on Create to Y if the transaction data fits into a 255-character string. You then do not need to stage the data in a file.

    If the transaction data must be staged, set the flag to N. webTF creates the new transaction record but does not process it right away. The client program then stages the transaction data in custom files, typically using the transaction ID as a key. After that, it calls the webTF program PRCTRN to trigger the transaction processing (for example, sending the DQ entry for the middleware to pick up).

  2. Create the pair of data queues in an application library that is already in the library list. It is generally not recommended to create them in WTF400, because you may need to reinstall it.

    CRTDTAQ DTAQ(<request-queue-name>) MAXLEN(255) FORCE(*YES) SEQ(*KEYED) KEYLEN(20) SIZE(*MAX2GB) TEXT('Request data queue')
    

    Change only the request queue name and library, and optionally the DQ text. Specify the other parameters exactly as shown. Repeat the same command for the response DQ.

  3. Optionally, for larger files, create staging tables.

    This step is specific to each application, and the structure of the staging tables varies. Typically, a staging table includes the transaction ID as a key. The MuleSoft middleware uses it to pull the correct data from the staging tables.

The webTF integration is now ready for use in your integration programs.

Using webTF in a program

webTF supports two modes:

  • Simple transaction: the message sent to the middleware fits into 255 characters. The application program uses the webTF program CRTTRN to create and process the transaction.
  • Transaction with data staging: the transaction process is split into the following steps:
    • Call CRTTRN to create a new transaction, without sending the entry into the data queue yet.
    • Using the transaction ID generated by CRTTRN as a key, add one or more records to the staging files.
    • After the transaction data is in the staging files, call PRCTRN. It generates a new DQ entry in the request data queue and waits for a response.

Detailed processing flow

  1. Caller program: calls the CRTTRN program to generate a new transaction ID.
  2. webTF: generates the new transaction ID and writes a new entry into the TRNHDR table.
  3. Caller program: optionally, if the transaction data must be saved into a table and retrieved by the middleware because it does not fit into the DQ entry, stages the request data into a custom table, using the transaction ID as a key.
  4. Caller program: optionally, for staged transactions, calls PRCTRN and passes the transaction ID as a parameter.
  5. webTF: places a new entry into the request data queue, using the transaction ID as the DQ key and the data passed by the caller program.
  6. webTF: waits for the response DQ entry with the same key (the transaction ID).
  7. Middleware: picks up the message from the queue.
  8. Middleware: processes the request, for example by calling the external API or generating a Word document.
  9. Middleware: places an entry into the response data queue, again using the transaction ID from the request entry as the key and, if necessary, the response data in the DQ body.
  10. webTF: upon receipt of the confirmation message, updates the transaction status in TRNHDR and returns control to the application.
    • webTF supports timeouts and retries. For example, it retries up to 2 times with a 10-second wait time each.
    • If no response is received within the defined timeout and retries, or the middleware has not picked up the entry, webTF changes the transaction status to PRCFAILED in TRNHDR, removes the transaction from the data queue, and returns the error to the caller.

CRTTRN and PRCTRN definitions

CRTTRN call prototype:

d crttrn          pr                  extpgm('CRTTRN')
d  transType                    10    const options(*nopass)
d  altTrnID                     30    const options(*nopass)
d  reqData                     254a   const options(*nopass)
d  transID                      20i 0       options(*nopass)
d  returnCd                      3s 0       options(*nopass)
d  returnMsg                   254          options(*nopass)

PRCTRN call prototype:

d prctrn          pr                  extpgm('PRCTRN')
d  transID                      20i 0 const options(*nopass)
d  transType                    10    const options(*nopass)
d  reqData                     254a   const options(*nopass)
d  returnCd                      3s 0       options(*nopass)
d  returnMsg                   254          options(*nopass)