ASNA Mobile RPG® Reference Manual |
Runtime Life Cycle
The lifecycle of a Mobile RPG Application begins when the end user makes a page request (by opening a website powered by Mobile RPG) that is handled initially by ASP.NET. ASP.NET uses the Global.asax page to perform the session_start and application_start processes and then the MobileRPGJob application is initiated. MobileRPGJob controls the user logon and calls the program or menu requested by the user via Execute_Startup_Program.
The RPG application, detecting the Handler "MOBILERPG" keyword, calls upon the Mobile RPG handler logic when an EXFMT command is encountered. This causes, with the help of DataGate and Telnet packet communications, the Mobile Display File to be used for the presentation layer both to and from the client.
When the user activates a control that mimics a cancel or exit function key to terminate their session, ASP.NET again uses the Global.asax page to pass control to the MobileRPGJob which closes the database files, disposes of the resources, and shuts down the job.
It can be broken down like this:
- User makes a page request (opens a website powered by Mobile RPG)
- On the Global.asax page, two processes are started:
session_start
application_start
- The
application_start
process activates the MobileRPGJob application -
MobileRPGJob calls the program or menu requested on
the IBM i, via the
Execute_Startup_Program
process, using the DataGate and Telnet utilities - The Mobile RPG enabled application detects the MOBILERPG keyword and calls the handler logic when an EXFMT command is encountered.
- The Job continues to run with input and output from the Mobile Display File.
- The user activates a control that cancels or exits (per the function key)
- ASP.NET uses Global.asax which begins the
Session_End
process, and passes control to the MobileRPGJob. - MobileRPGJob does the
following:
- Closes the Database files
- Disposes of the resources
- Ends the Job
- Calls EoJ.aspx, which performs the
Session_Abandon
process and displays the End of Job page in the browser.
Important: This model presumes that the user does not have Limited Capabilities, see the Limited Capability Users topic for details on how the life cycle works in those scenarios.