Gen Example Model : INLINE CODE statement for Java
search cancel

Gen Example Model : INLINE CODE statement for Java

book

Article ID: 245582

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

INLINE CODE for Java.
-  How to access the HttpServletRequest object, execute methods on that object, and display the results of those methods.
-  How to modify the contents of a Repeating Group View (RGV).

Environment

Component : Gen Workstation Toolset

Resolution

Inline Code has many benefits over EABs, especially since the code is kept with the model.  It is recommended that all new "external" logic to be done with Inline Code instead of EABs, where possible.
 
Here are a few links that might be useful pertaining to Inline Code:

Add an Inline Code Statement

Add or Edit Inline Code Dialog

Insert View Reference Dialog

Add Inline Code Statements Containing ODBC, JDBC, or ADO.NET Statements

Attached is a model that provides two examples of using Inline Code in Java:
  • The first example shows one way to modify the contents of a Repeating Group View (RGV).
  • The second example shows how to access the HttpServletRequest object, execute methods on that object, and display the results of those methods.

 
This model contains a Window-packaged application for Procedure step CLIENT_PSTEP contained in Windows Manager LM1 (trancode TRN1):

  • It should be generated/installed with the following Generation Options: JVM, <NONE>, JAVA, INTERNET, <NONE>, Local.
  • After Assembling the application's .ear file, it should be deployed to an Application Server.
  • The application can then be accessed with a URL similar to the following: http://<host>:<port>/<context>/trn1.jsp.
  • When the application's window is first displayed, the list box will be populated with example data.
  • When clicking the "Modify RGV with Inline Code" pushbutton, the contents of the RGV will be modified by executing Inline Code in the pushbutton's event handler.
  • When clicking the "Query HttpServletRequest" pushbutton, the pushbutton's event handler will USE the Action Block ACCESS_HTTPSERVLETREQUEST, which contains Inline Code to execute methods on the HttpServletRequest object.

While this model does not contain a real-world example, it does at least provide a starting point to understanding how Inline Code might be used for Java.

Additional Information

Lynn, July 2 2024:
July Broken link project.
Fixed 2 broken techdocs links and changed all 4 links to have anchor text.
Also added bulleting for easier reading and some more details about the model.
Re-added the inline.ief.zip file without the leading numbers in the name which old system added.

Attachments

inline.ief.zip get_app