BusinessLink File Transfer Event Processing |
Product: | BusinessLink/WEB | |
Modified Date: |
File transfer event processing is a tool used to automate actions that either the iSeries 400
or the BusinessLink/REMOTE client perform when the file transfer has completed. On the
iSeries 400, this may include copying the received file to a separate library and performing
operations on the data. On the remote PC using BusinessLink/REMOTE, received files can be
copied to different directories or loaded by third party applications such as spreadsheet
programs to view the received data file. In both circumstances, the actions performed by
either the iSeries 400 or client PC is under complete control of the BusinessLink administrator.
The goal of this bulletin is to explain the process behind event processing, detail the configuration requirements on the iSeries 400 and client PC and provide examples of how to implement file transfer event processing. What is an Event? Events can be best visualized as actions performed on a received file. When a file is transferred to the iSeries 400 using the ABAPI or 'Send File' toolbar option in BusinessLink/REMOTE, the BusinessLink iSeries 400 software determines if an event has been associated with the file. If an event exists and a appropriate event handler (i.e. user program) has been created on the iSeries 400, the iSeries 400 event handler is transferred the system reference number for the file. From there, the event handler can perform any required action for the database file on the iSeries 400. The same sequence of events occurs when sending a iSeries 400 database file to a BusinessLink/REMOTE client using the ABLAPI or 'Send File' option from the ABL main menu on the iSeries 400. When the database file has been received, BusinessLink/REMOTE determines if a event handler has been defined for the file and, if so, passes the system reference number to a DOS batch file or Windows executable for appropriate processing. ![]() Many references will be made to a data file 'system reference number'. Every file sent to or from the iSeries 400 is automatically assigned a unique system reference number. Working with sent and received files (ABL menu option 1) displays all files processed by BusinessLink iSeries 400 software and their associated reference numbers. iSeries 400 Event Processing Configuration iSeries 400 Send Events Send events in file transfer from iSeries 400 to BusinessLink/REMOTE clients are specified on the ABLAPI file transfer command or from the 'Send File' ABL main menu option. For example, the following displays how to send a iSeries 400 database member named ACCOUNTS of file named DOWNLOAD in library OUTGOING to BusinessLink/REMOTE user registration 5 with the event of PROCESS. ![]() Once BusinessLink/REMOTE receives this file, it checks to see if an appropriate handler for the event PROCESS has been defined. If so, the handler program is executed. If not, the file is received and further processing is terminated. iSeries 400 Receive Events The maintenance of received file events on the iSeries 400 can be done through the standard administration menu: 1. From iSeries 400 command line enter 'GO ABL/ABL'. 2. Select option 30 (Administration Menu). 3. Select option 5 (Work with Received File Events). You will be presented with the following display, which shows all currently configured received file events on the iSeries 400. ![]() From this display you have the option to create, edit, delete, and display received file events. For example, if we were to create a received file event called 'ORDERS' which was to call an application program 'PROCESS' in library 'LIVEDATA', press 'F6' (Create) and enter the following received file event parameters: ![]() Once this event has been created, data files sent from BusinessLink/REMOTE users with the event 'ORDERS' will have the system reference number of the received file passed to application program 'PROCESS' in library 'LIVEDATA'. The only prerequisite for creating new events is that the application program exists on the iSeries 400. Additionally, any create, change or delete of received file events on the iSeries 400 requires that the ABL subsystem be ended and restarted for configuration changes to take effect. An example of the CL source program PROCESS is listed below: ![]() BusinessLink/REMOTE Event Processing Configuration The maintenance of sent and received file events is done by selecting 'Configure / Events & File Handling' in BusinessLink/REMOTE. The following screen will be displayed: ![]() Send Events Send events are those specified for PC data files sent to the iSeries 400 to be processed by a iSeries 400 receive file event. The only prerequisite for creating a send event is that the record length of the data file to be sent is known. BusinessLink/REMOTE does not dynamically determine the record length of every file sent to the iSeries 400. For example, to create a send event which describes a data file named 'data.txt' in directory 'C:\UPLOADS' with a record length of 128 bytes the following would suffice: ![]() Once BusinessLink iSeries 400 software receives this file, it checks to see if an appropriate handler for the event PROCESS has been defined. If one exists, the action defined for the handler is executed. If an event handler does not exist, further processing is terminated after the file has been received. Receive Events Receive events are those created to perform additional processing on files sent from the iSeries 400 to BusinessLink/REMOTE clients. For example, to create a receive event for all files sent from the iSeries 400 with the event PRICES which calls a DOS batch program named COPYPRC the following would suffice: ![]() Once BusinessLink/REMOTE receives a file from the iSeries 400 with the event PRICES, the program COPYPRC would perform additional user processing specified in the program. The only prerequisite for this event handler to be executed is that the program COPYPRC be on the system path (recommended that all events reside in the installation directory of the BusinessLink/REMOTE software). BusinessLink/REMOTE will automatically pass a total of 6 command line arguments to the handler program. An example of the DOS batch program COPYPRC including descriptions of arguments passed is listed below: ![]() Possibilities Event handling is a very powerful feature of BusinessLink. Customers have used event processing in numerous different environments performing a multitude of tasks. The following is a real world example of event handling being used by many customers to send daily orders to the iSeries 400 and receive confirmation after appropriate processing has completed on the iSeries 400: 1. The BusinessLink/Remote client is configured to automatically connect, send daily orders file, disconnect, then enter 'call wait' mode. This setup can be done using a DOS batch program which uses the ABAPI file queuing command then calls the BusinessLink/REMOTE application with the proper command line switches. Once the batch program has been created, a shortcut can be placed on the user's desktop or the program can be configured using a scheduler to eliminate user intervention. Refer to the administrator's manual for further information on the usage of these features. 2. The iSeries 400 receive event handler processes the received orders file then sends a confirmation file to the BusinessLink/REMOTE client using the 'outdial' feature of the ABLAPI iSeries 400 command. 3. BusinessLink/REMOTE answers the incoming call from the iSeries 400, receives the order confirmation file, copies the confirmation file to a location on the local workstation and terminates the call. As you can see, the available complexity of event processing can be used to provide solutions for many file transfer requirements. Summary The use of event processing can aid in the automation of file transfer processing to and from the iSeries 400 using the BusinessLink/Remote client. Processing at the iSeries 400 or client end is not limited to the examples above which are only meant to show how to access the received data file. The action to be performed once received is up to the creator of the event handler. For BusinessLink/REMOTE receive event handling, it is possible to make configuration and event handler programs standard issue for newly generated BusinessLink/REMOTE diskettes. Contact BusinessLink Technical Support for further information regarding this topic. The BusinessLink Administrators manual has additional information relating to this topic. The most recent version can be found here. ** End of Technical Support Bulletin ** |
![]() |