The SEND-TO-LINC paragraph is performed by the main loop routine ML-01 when input has been received through a port file, and is also performed by GET-COMS-Message when input has been received from an external station through COMS. Refer to GET-COMS-Message for more information.
SEND-TO-LINC takes messages initiated from outside your application, and passes them to your application. These messages have come from either the port file interface, or from an external station through COMS.
The message is moved to a temporary message text area.
As different messages come in different formats, the messages are later moved to the correct area for their format. This enables the header to be inserted in front of the message.
Insert your own code at this point in the routine to reformat the message if necessary, prior to sending to the application.
The date and time are placed in the message to be sent to your application.
If the input was from a station (that is, the port file input flag is not set):
The station name is obtained by using a call to DCILIBRARY.
The station name is replaced in the message to be sent to your application.
NOF is placed in front of the station name, to avoid confusion with the COMS station name.
If the call to DCILIBRARY does not return a valid station name, the invalid result is displayed and your NOF program is terminated.
If the input was from a port file, the station name in the message to be sent to your application is set to the value PORTFILE.
The message type in the message to be sent to your application is set to indicate NOF input to your application.
The paragraph FIND-STATION is performed.
This code segment is optional. If you want your application to retain session data (Glb.Work) in memory rather than in the database, you must leave this code segment in. If only the station name is sent to your application, session data cannot be retained in memory alone: it must be stored in the GLB-DIALOGINFO structure in your database.
Refer to Preserve Session Data Segment configuration property in the Agile Business Suite Developer User Guide for more information.
FIND-STATION searches an internal station table for the station number, which is passed to the application in the GL-PARENT-REQUESTOR property. This value is the unique key used by your application for handling session data for that station.
If the station is not found in the internal table, then GL-PARENT-REQ-VALID is set to a space, to indicate that the dialog information is not yet known.
The internal station table is loaded with station details during the processing of replies from the application. At this stage, stations that do not appear in the station table are added to it, and the PARENT-REQUESTOR assigned by the application is stored with the station details. Refer to PROCESS-LINC-RESPONSE for more information.
The message text is moved into the appropriate property for transmission to your application.
The message headers properties are set, including setting the station type to 9 (meaning programmatic NOF input to an application) and setting the transaction language.
If your <<Ispec>> class logic changes the transaction language, the new language number is contained in the property GL-MSG-NEW-LANG in the reply from your application. To make use of the new language, add your own code as required.
The COMS routing is defined by moving the router designator of your application (obtained during setup) to the COMS-OUT-AGENDA. This is needed by COMS to ensure the message that is about to be sent is sent to the correct destination.
The message length is entered in the header. If your messages are input from a port file, ensure the correct message length is entered. If your messages are input from a station through COMS, the program calculates the correct length.
The <<Ispec>> class name in the message text has any hyphens changed to underscores. (<<Ispec>> class names for the Report Output Control system often contain hyphens, which are not acceptable to COMS within transaction names.)
The message is sent to the application, and a check is made for any COMS send errors. If a send error occurs, the error is displayed.
NOF should not send another input from a station to your application until the last input for that station has been replied to from the application. Transactions are terminated by an &&&&& message. If this is not managed by your external stations, you must add code to ensure this does not occur. This does not apply to Administration (colon) commands, which do not have to wait for replies. The replies to Administration commands are not terminated by an &&&&& message.