In its simplest form, each WEBROUTINE in a WAM is associated with one XSL stylesheet, which defines the presentation layer, also known as the Web Design. Once a WEBROUTINE is invoked, only that WEBROUTINE's page will be returned. Sometimes, however, it is necessary to "redirect" execution to a different page from RDMLX. For example, a WEBROUTINE might be requested but the session has expired. In this case, it may be necessary to display an error page or a different page to the one requested.
Another example is a Logon page with a single logon button to invoke a Logon WEBROUTINE. This WEBROUTINE authenticates the user and depending on whether the user is a registered user or a guest, it would "redirect" to the appropriate WEBROUTINE and present the appropriate page. There are many other examples where it may be necessary to "redirect" from one WEBROUTINE to another.
This "redirection" can be accomplished with the use of a TRANSFER statement. The fields are mapped to the target WEBROUTINE according to that WEBROUTINE's WEB_MAP statements. Only fields and lists specified on the incoming WEB_MAPs are passed to the target WEBROUTINE.
The TRANSFER statement has the following properties:
|
When a TRANSFER is performed, the target WEBROUTINE assumes control of execution and the source WEBROUTINE does not regain control. When the target WEBROUTINE is exited, that WEBROUTINE's page is returned, as if the WEBROUTINE was invoked directly from the browser.
The following are some examples of TRANSFER statement:
TRANSFER TOROUTINE(Browser)
TRANSFER TOROUTINE(#MYWAM.Browser)
TRANSFER TOROUTINE(*SERVICE EmployeeBrowse)
change #WEBRTN 'wam1.routine1'
TRANSFER TOROUTINE(*EVALUATE #WEBRTN)