2.3 Types of Web Functions

With LANSA, you can deploy two types of functions:

Procedural Functions

LANSA allows you to Web enable your existing procedural LANSA applications for execution over the Web. LANSA provides a transaction server to maintain the state of the functions as they execute. For details, refer to LANSA Web Function Transaction Server.

For example, the Personnel Demonstration system executes on 5250 terminals using an IBM i and executes under Windows on a PC. This application was written as a procedural function in 1987. This application was written as a procedural function in 1987. The Personnel Demonstration system can be Web-enabled and recompiled, and then it can be executed over the Internet. Refer to  2.9 Executing Applications: Process Menu. and you can try it out for yourself. The Personnel System has been web enabled for you and you can try it out for yourself. See Note following.

When a procedural function executes over the Web, the user cannot use the browser’s Back button. In order to navigate within the application, the user must use the Cancel button (which is equivalent to an F12=Cancel request) which is automatically included into the application by LANSA. The application executes in a procedural mode just like it would using a 5250 terminal on the IBM i.

All procedural functions that will run on the web should have the EXIT_KEY enabled. Having the EXIT_KEY disabled could result in unpredictable behavior. For example, a function might never timeout or, in some circumstances, use an abnormally large amount of CPU time.

WEBEVENT Functions

LANSA allows you to code functions specifically for the Internet user and the browser paradigm. In the browser paradigm, a persistent connection is not required. Each page is independent. You cannot dictate the navigation path of your application to the user. The Internet user has a Back button in the browser which allows them to go back several pages and resubmit a request.

A function is defined to be a WEBEVENT function by specifying the following option in the FUNCTION command:

FUNCTION OPTIONS(*WEBEVENT)

With WEBEVENT functions, the LANSA function will terminate after a DISPLAY or REQUEST command is executed. No other logic will be executed after the HTML page for the function is sent. Using this technique, you must code your functions to properly process the information when the user decides to submit a screen with data. The logic of the RDML function must be written specifically for WEBEVENT. You cannot simply add the *WEBEVENT keyword to your functions.

The majority of your newly created Web applications will be written as WEBEVENT functions.

For more details, refer to WEBEVENT Functions.

 

WEB001 - Types of LANSA Web Functions

 

Note: The LANSA Personnel Demonstration System was originally created in 1987 to execute on a System 38.  This same application can still be executed on IBM i as well as Windows, WEB and Linux platforms. The original database and application are virtually unchanged.  There have been some extensions to the database to demonstrate RDMLX concepts.

There are two web versions of the Personnel System, one uses WEBEVENT technology and the other uses WAMs.  These are included with the IBM i demonstration material and can be checked out to a Visual LANSA environment as required.  These applications can be used to give you ideas of how to create and include the elements required for both WEBEVENT and WAM processing.

webevent (web enabled RDML or RDMLX partition):
http://<web server>/cgi-bin/lansaweb?procfun+lansadem+ldem+dem

wam (web enabled RDMLX partition, only supported for technology service LANSA:XHTML):
http://<web server>/CGI-BIN/lansaweb?wam=LWAMDEM&webrtn=ldemhome&ml=LANSA:XHTML&part=DEX