NOF Transaction Flow

This subsection describes how to interface to NOF in your logic, in a situation where transactions are initiated by your application. Refer to Appendix C, System Message Routing for more information about the illustration of this process.

Note: This gives only one possible example of a NOF interface. The NOF interface is by its nature extremely flexible, and it is impracticable to give examples of all possible variants.

In this example, the procedure has the following:

  1. Define the Destination

    Move a value of NON.FORMAT to Glb.Destination in your logic. This signifies that the following AUTO; command is to be directed to an external NOF program, as named in Glb.DestNoForm.

  2. Define the NOF Program

    Move the name of the NOF program (COMS program name) you require to Glb.DestNoForm. If you do not do this, Glb.DestNoForm defaults to window NOF (where window is the name of the window for your application).

  3. Set up the Auto Entry buffer

    Your logic contains instructions to Agile Business Suite to format the message according to the layout of the <<Ispec>> class specified. For example, an <<Ispec>> class INOF has attributes defined as follows:

    Attribute

    CUSTCODE

    (Name)

    CUSTCODE

    IsKey

    No

    Direction

    InOut

    Persistence

    No

    Type

    Number

    Length

    4

    Decimals

    0

    Attribute

    CUSTBALS

    (Name)

    CUSTBAL

    IsKey

    No

    Direction

    InOut

    Persistence

    No

    Type

    Number

    Length

    8

    Decimals

    2

    Attribute

    INMESSAGE

    (Name)

    INMESSAGE

    IsKey

    No

    Direction

    InOut

    Persistence

    No

    Type

    String

    Length

    80

    Decimals

    2

    INOF is specified in the Automatic Entry as follows:

    GLB.DESTINATION := "NO.FORMAT"
    INOF_Auto.initialize()
    INOF_Auto.CUSTCODE := CUST.CUSTCODE
    INOF_Auto.CUSTBAL := CUST.CUSTBAL

    The message to the NOF program has the following format:

    custcodecustbalinmessage

    The custcode and custbal values represent the contents of the CUSTCODE and CUSTBAL items, respectively. The inmessage value is set to spaces for outward messages, and contains any processed data for the incoming reply from the NOF program (explicitly placed there by the NOF program logic.)

  4. Send the Message to the NOF program

    Invoking the Store() method on the <<ispec>> class in your logic sends the message to the NOF program.

    INOF_Auto.store()

    The message has the standard Agile Business Suite header, in the following format:

    ispecTtrannoinputdateactmth[maint]message

    The maint value, representing the contents of the Maint built-in attribute, only applies to <<ispec>> classes with one or more key persistent attributes, or having a default profile.

  5. Wait for Response from NOF program

    The system waits for a maximum of 60 seconds for a reply from the NOF program before aborting with an appropriate error message.

    Set the timeout value using the MAXWAIT task attribute. Refer to MAXWAIT. However, if MAXWAIT is greater than 60 seconds, a timeout value of 60 seconds is applied.

  6. Test the Value of Glb.Status

    Test the value of Glb.Status in your logic to determine the result of the AUTO; WRITE command, as shown in the following table.

    If Glb.Status is…

    Then the AUTO was…

    Spaces

    Successful, but no data was returned.

    DATA

    Successful, and data was returned.

    *****

    Unsuccessful – the NOF program encountered an error.

    NODB

    Unsuccessful – the NOF program was not available.

    BUSY

    NOF program had insufficient resources to process the AUTO.

    BLOCK

    Transaction was sent, but the NOF program became available. The status of the transaction is unknown.

    TOUT

    The timeout elapsed before the transaction completed (must be coded in the NOF program).

  7. Process the Returned Data

    The NOF program sends data back to the Automatic Entry Buffer in LINCOFF format. In your logic, you might retrieve data from the instance you are using as the Automatic Entry Buffer to other attributes or Group Setup Data Items. Refer to NOF Ispec Screen Data Format for more information on LINCOFF format.

    For example, the attribute INMessage in <<Ispec>> class INOF is used to receive a message string from the NOF program. Group Setup Data Items are then used to break down the string. Assuming that there is a <<group>> class called SDGROUP with two members, SDSTATUS (a string of length 10) and SDAGE (a string of length 4), the message in INOF.INMessage can be broken down as follows:

     IF GLB.STATUS = "DATA"
    		SDGROUP := INFO_Auto.INMESSAGE
    		IF SDSTATUS = "EXCEEDED" AND :Sample logic testing
    		SDAGE > "30" :Returned values
    		.
    		.
    		:(User logic here)
    		END
    END