Informix User Forum 2005Moving Forward With Informix Converting Your Informix 4GL Application to EGL Jin Zhang Software Development Manager IBM Atlanta, Georgia December 8-9, 2005
Agenda • Rational Development Environment & EGL Overview • I4GL to EGL Conversion Utility • Overview • Conversion Process • Post Conversion Steps • Re-conversion, C-Interface, Reporting • Deployment and Runtime • Demo: Converting I4GLDEMO to EGL • What Conversion Utility Cannot Do • Best Practices • Summary & Resources • Q&A
Rational Developer Products IBM Rational Developer Products Rational Software Architect Rational Application Developer functionality Rational Web Developer EGL Eclipse Java Development Tools
EGL • A language as easy as I4GL to use and perform s/w development. • Provides an industry standard IDE (Rational Application developer) for developing EGL, Java, Web and COBOL applications. • Provides an enriched set of the same capabilities. • Text user interface (Graphical & Curses based). • Calls to “C” functions. • SQL (embedded, dynamic and more). • Interactive debugging capability. • Powerful reporting capability. • Command line based application development. • Data types (all of I4GL and some more in addition).
EGL ..... • In addition to the I4GL feature set, it provides • Development and runtime capabilities for Windows platforms. • More general programming capabilities. • Web Application development and deployment. • Same business logic can be shared in both deployments. • Multiple Database connectivity. • Uses JDBC and allows to connect to any DB. • Service Oriented Architecture (Web Services). • MQ Access. • File I/O • Provides for COBOL generation options (deployable in i-Series and z-Series). • Calling out Java code from EGL. • and more…
What is the I4GL EGL Conversion Solution ? • Transform • Convert Informix 4GL logic to EGL • Use Conversion Utility (part of Rational Application Developer) to automate conversion • Convert on a program-by-program basis • Enhance • Leverage IBM Rational Software Development Platform • Enhance, maintain, debug EGL business logic • Expose transformed EGL programs as Web Services • Create new User Interfaces for TUI, GUI, Web and Portal • Integrate with existing applications, middleware and databases • Re-generate to support new databases or middleware • Deploy • EGL deployed as a 100% Java/J2EE application for WebSphere • Automatic EGL to Java conversion and deployment • Supports Windows, Linux, AIX, Solaris and HP, iSeries, zOS CICS , Batch, IMS
How is this going to be Done? • Using a wizard that comes as a plug-in to your environment. • Directories can be mounted from current environments • or files can be copied • GUI wizard to choose appropriate directories and files • Output will be EGL files and an EGL conversion “project” • Command line conversion utility will run in current build environments • Utility will require an input file describing conversion: • Search directories • File names • Output will be EGL files (abc.4gl abc.egl)
4GL Project 4GL modules (.4gl) 4GL Forms (.per) User Shared Library (.so) (Created from .4gl, .esql, .c) Message Files (.msg) 4GL Program 4GL Runtime Library (lib4gsh.so)
EGL Project EGL modules (.egl) EGL CUI Forms (.egl) Jasper Report (.jrxml) EGL Shared Library (.jar) Message Files (.properties) User Shared Library (.so) (from .esql, .c) EGL Program EGL Runtime Libraries JRE C- Interface Stack Library Jasper Runtime Libraries
Conversion Assumptions • I4GL code is “legal” • it will compile with I4GL 7.32 compiler • conversion will not “fix” invalid I4GL code • Multiple passes are required • Functions that can not be resolved during conversion are assumed to be C code functions • if function is later found to be an I4GL function, re-conversion would be required • C code functions do not use undocumented I4GL internal functions
Conversion Strategy • Goal is to convert an I4GL application to the equivalent EGL application that uses: • the same display device • the same database server • I4GL TUI applications will be converted to EGL TUI applications • Convertion is to be done on a program-by-program basis. • Conversion utility is provided: • as part of the IDE • also available from the command line • Separate conversion passes required for: • database metadata extraction • shared libraries (C code or combination of C and I4GL code) • I4GL source code • Automated conversion should convert most 4GL source code • but, some 4GL programs may require manual intervention
Conversion Process • Conversion Project can take up to 3 steps • Database Schema Extraction • I4GL Shared Library Conversion • I4GL Application Conversion • Conversion should take place in the order listed above • Shared Library may sometime require “reconversion”
Conversion Artifacts • Configuration file • XML file generated from interaction with conversion wizard • contains required conversion project information • Manifest file • XML file generated during conversion of shared libraries • contains declaration and usage information about each of the functions (C and I4GL) used in the shared library • used to resolve function declarations in dependent I4GL shared libraries • required for subsequent I4GL source code conversions • Log file • contains warnings and errors • status of each source file • summary of conversion
Pre-conversion steps • Identify various components of the existing project that needs to be converted. • List all the source files under each component. • Organize your code into proper modules to make the conversion more modular. • Ensure that your I4GL code compiles with the 7.32 compiler. • Make sure that the database server is up and running.
EGL Source EGL build descriptor EGL Source Conversion artifacts… Database Schema Source 4GL Source Informix 4GL to EGL Conversion Utility Conversion Configuration Manifest file Conversion log
Post Conversion • Needs to be done for each of the conversions. • Verify the log file for Warnings. • Refer the “readme.html” in EGL plug-in directory. • Refer “Readme<Version#>FGL.html” in Conversion Tool plug-in directory. • Refer the converted EGL source for “FIXME” and “TODO” • Open the new projects and fix any validation errors. • Set runtime environment necessary in one of the property files. • Right click on the project, select Properties • Associate a EGL build descriptor for the project • If needed, add JDBC jar files in “Java Build Path” • Select the project in the “Project Explorer”, right click for pop up menu and select “Generate” option • Java source is generated in “JavaSource” directory • Run the application.
Reconversion • Needed only for shared library projects • Application conversion is the only place where all dependencies get resolved. • Manifest file is reconciled • Dependent Shared Library needs to be reconverted
Integrating “C” code. • At the time of application conversion, the conversion tool creates C code files like function table map. • These files need to be compiled and linked with the EGL provided objects and shared libraries. • Application.obj • stack.dll, stack.lib • There may be a requirement for using fglsys.h which can be located in EGL installation. • Other header files may be required like locator.h, decimal.h, datetime.h, ifxtypes.h and int8.h. • Once done, make sure that the shared library is in one of the directories indicated by LD_LIBRARY_PATH and your PATH variable. • Download “Stack Library” and “application object file.” • Use “Native Function Table” generated. • Create new APPLICATION SHARED LIBRARY • Java runtime option to load shared library “-D vgj.defaultI4GLNativeLibrary=<application shared library name>”
Report Conversion • Report Business Logic gets converted into EGL • Report Presentation Logic gets converted into Jasper Reports • Jasper compilation built into RAD. • Third Party Reports designers can be used to enhance the reports
Nature of Jasper Report • JasperReports is a Java Class library. • Defines specifications for XML based report templates. • Provides Java utility classes to compile, run and export reports. • Capabilities of Jasper report: • Pre-defined templates for page layout. • Can generate reports in multiple formats. • It is also extendable by custom exporter (such as EGL’s Plain Text Exporter) • Can use external Java code for complex expression processing. • Generates reports using complete result set. • Supports Sub-Reports.
Separation of Business logic and Presentation logic 4GL Report Conversion Presentation logic Jasper XML Designs 4GL Report Communication EGL report handler or Jasper scriptlet class Business Logic
Deployment and Runtime • Create a JAR file for deployment. • Use EGL runtime libraries “fda.jar” and “fda6.jar” on target machine for runtime. • Can be found in “redist\EGLRuntimes” of your installation CD.
Demo: • Extract Stores7 Schema • Convert I4GLDemo programs • C-interface example
What Conversion Utility Cannot Do • Cannot fix invalid 4GL code • Cannot convert C libraries • Cannot take the I4GL application to web
User Experience - Internal • Converted our Product Tracking System (about 250 files, 70,000 lines of code) • 175 4GL files • 74 form files • 1 message file. • 8 ESQL/C files • 7 C files • Effort took 4 weeks. • Actual conversion process less than 15 minutes. • Converted EGL (in lines of code was about the same about 85000 lines of code). Most of it were due to comments and leaving the original 4GL code intact (around comments). • The rest of the effort was to test each and every screen, identify certain behavior differences, enter bugs. • Most of the issues entered have already been fixed. • Tested other large scale customer applications in-house and have made it part of our regular “sanity” list.
User Experience - External • Large Retailer in Europe • Major Automobile Manufacturer in US • Proof of Concepts in Asia Pacific (Double-byte) • More…
Some Best Practices Using Conversion Utility • Read through the Conversion Utility Users’ Guide & Readme! • Break large I4GL application into logical projects before conversion • Getting comfortable with EGL and the IDE will speed things up • One-time conversion then move on to EGL! • Keep in mind that sometimes modifying the 4GL code may make the re-conversion easier.
BL BL C functions C functions BL c_code.so c_code.so BL Text Reports BL SchemaLib.egl inventory.egl inventory.4gl catalog.egl catalog.4gl main.4gl main.egl form.per form.egl IDS BL BL BL Typical I4GL Program … Becomes Typical EGL Program I4GL to EGL Conversion Text Reports
BL C functions c_code.so DB2 IDS Webinventory.egl SchemaLib.egl Webmain.egl inventory.egl catalog.egl main.egl BL BL BL Now What Can You Do With It … Use your I4GL Business Logic in EGL Web Services Use your I4GL Business Logic in whatever comes next!!! Use your I4GL Business Logic with Message Queues HTML Output XML Output PDF Output Text Reports
4GL/EGL Redbook Free to download via ibm.com (Search for 4GL to EGL RedBook) printed copy orderable via amazon.com • EGL Language Concepts • The Rational SDP environment • A simple EGL web application • 4GL to EGL conversion • EGL and databases • Advanced EGL web rogramming • EGL and JasperReports • EGL Deployment (standalone and web) • EGL CUI applications • plus much more...
EGL Zone on IBM DeveloperWorks • EGL Tutorials • EGL Documentation • EGL Code Examples • An active EGL Forum • plus more... http://www.ibm.com/developerworks/rational/products/egl/
Reference • Conversion Utility User guide : • ftp://www6.software.ibm.com/software/developer/library/rational/pdf/4gl_to_egl_conversion_user_guide.pdf • Conversion Utility README file : <RAD_HOME>/egl/eclipse/plugins/com.ibm.etools.i4gl.conversion_<version>/readme.html • Configuration file and DTD examples : <RAD_HOME>/egl/eclipse/plugins/com.ibm.etools.i4gl.conversion_<version>/etc/ • Stack Library download site : http://www3.software.ibm.com/ibmdl/pub/software/rationalsdp/rad/60/redist/ • EGL Help content : Use RAD menu, Help->Help Contents for EGL documentation • EGL Zone on developerWorks (with Tutorials and downloads) : http://www-128.ibm.com/developerworks/rational/products/egl/ • Jasper Reports: http://jasperreports.sourceforge.net/ http://www.jasperassistant.com/
Upcoming Learning Events about RAD & EGL • IDUG 2006 NA Conference • May 2006, Tempa, FL, www.iiug.org • InfoBahn Events Worldwide • Refer to www.iiug.org for schedule detail • Chat with Lab throughout the year • Check with Anita McKeithen (mcKeithe@us.ibm.com) for final schedule
Informix User Forum 2005Moving Forward WithInformix Converting Your Informix 4GL Application to EGL Jin Zhang email@example.com Atlanta, Georgia December 8-9, 2005