Changes made by the V7.0 migration tool

The EGL V7.0 migration tool makes the changes that are listed in this topic. You can control some of these changes by setting the migration tool preferences. For more information, see “Setting the EGL migration tool preferences.”

General changes

Changes to projects
If you run the migration tool on an entire project and that project contains a Service part or a Service Binding Library, the migration tool adds an EGL Deployment Descriptor file to the project. For more information, see "Services" in this topic.

If you enable the preference to delete Java™ files, the migration tool deletes the Java files from your projects so that the Java files can be regenerated from the EGL source. This change affects only the Java files that are in the same project as the EGL code you are migrating. If you are generating the EGL code into a different project, manually delete those Java files.

The migration tool updates project classpaths to reflect new names and locations of JAR files; this update includes removing JAR files that are no longer used.

New reserved words
Depending on the preference settings, the migration tool adds a prefix or suffix to existing names that conflict with new reserved words.

Properties

Changes to existing properties
Changes the values of properties that are no longer quoted strings. This change includes the pcbParms property, for which the migration tool changes empty strings ("") to NULL.

Changes the keyItem property on records with the relativeRecord stereotype to the recordNumItem property.

Changes the isNullable property to isSQLNullable.

Changes the values of the protect and outline properties on Text UI form fields to the ProtectKind and OutlineKind enumerations. Because the outline property is now an array, the migration tool puts the value of outline in brackets. The migration tool does not change the value of protect on fields in a ConsoleForm record.
Table 1. Changes to the protect and outline properties on Text UI form fields
Old property and value New property and value
protect = yes protect = ProtectKind.protect
protect = no protect = ProtectKind.noProtect
protect = skip protect = ProtectKind.skipProtect
outline = box outline = [OutlineKind.box]
outline = noOutline outline = [OutlineKind.noOutline]
Exception compatibility
The migration tool sets v60ExceptionCompatibility to YES on the following logic parts:
  • Program
  • Library
  • Handler
  • Service
Text literals
To preserve behavior from previous versions, the migration tool adds the code textLiteralDefaultIsString = NO to the following parts, depending on the preferences:
  • Program
  • Library
  • Handler
  • Service
  • Records

Build descriptor options

wrapperCompatibility
If your .eglbld file does not include the wrapperCompatibility build descriptor option, the migration process checks the value of the enableJavaWrapperGen build descriptor option. If enableJavaWrapperGen is set to YES or ONLY, the migration adds the wrapperCompatibility build descriptor option and sets it to V6.
For more information about wrapperCompatibility, see “wrapperCompatibility.”

Variables

Variable scope within code blocks
Variables are now in scope after, not before, their declaration: for more information, see "Scope of variables within functions" in “Changes made by the V7.0 migration tool.” The migration tool moves all local variable declarations to the beginning of the code block. If that variable was initialized, the migration tool converts the initializer into an assignment statement and leaves the assignment statement in the original location of the variable declaration. If the variable was already at the beginning of the code block, the migration tool moves its initializer into an assignment statement and puts that assignment statement at the end of the variable declarations.
Default specifier for INTERVAL variables
The migration tool adds a default format specifier to INTERVAL variables without a specified format:
Table 2. Changes to INTERVAL variable declaration
Old code Migrated code
intval1 interval; intval1 interval("yyyyMM");

System functions and variables

General changes
  • The migration tool changes the uses of system functions and variables that have changed names.
  • The migration tool changes uses of the sysLib.convert() system function to use the ConvertDirection enumeration, as in this example:
    sysLib.convert(myOrderRec, ConvertDirection.local, myConvTable);
    Values of "L" and "R" are changed to ConvertDirection.local and ConvertDirection.remote, respectively.
  • The fourth parameter of the SqlLib.Connect (formerlySysLib.Connect) system function, commitScope, is no longer needed, so the migration tool removes it.
  • If the following arguments are not specified, the migration tool specifies them as follows:
    Table 3. Changes to calls to SqlLib.Connect
    Old code Migrated code
    isolationLevel serializableTransaction
    disconnectOption explicit
  • The following table contains examples of how the migration tool deals with invocations of SqlLib.Connect:
    Table 4. Changes to calls to SqlLib.Connect
    Old code Migrated code
    SysLib.connect( a, b, c );
    SQLLib.connect( a, b, c, 
        explicit, 
        serializableTransaction );
    SysLib.connect( a, b, c, d );
    SQLLib.connect( a, b, c, 
        explicit, 
        serializableTransaction );
    SysLib.connect( a, b, c, d, e );
    SQLLib.connect( a, b, c, e, 
        serializableTransaction );
    SysLib.connect( a, b, c, d, e, f );
    SQLLib.connect( a, b, c, e, f );
    SysLib.connect( a, b, c, d, e, f, g );
    SQLLib.connect( a, b, c, e, f, g );
  • To maintain compatibility with rounding rules in previous versions, uses of MathLib.round() with only one argument are changed to use MathLib.assign(). Uses of MathLib.round() with two arguments are not changed.
    Table 5. Changes to uses of MathLib.round()
    Old code Migrated code
    result = round(x); assign(x, result);
    result = round(x, powerOfTen); No change.
    Also to maintain compatibility with rounding rules in previous versions, the migration tool wraps calls to functions in MathLib within MathLib.assign():
    Table 6. Changes to uses of functions in MathLib
    Old code Migrated code
    result = abs(x); assign(abs(x), result);
    result = pow(x, y); assign(pow(x, y), result);
    This change affects these functions:
    • MathLib.abs()
    • MathLib.acos()
    • MathLib.asin()
    • MathLib.atan()
    • MathLib.atan2()
    • MathLib.cos()
    • MathLib.cosh()
    • MathLib.exp()
    • VGLib.floatingDifference()
    • VGLib.floatingMod()
    • VGLib.floatingProduct()
    • VGLib.floatingQuotient()
    • VGLib.floatingSum()
    • MathLib.frexp()
    • MathLib.ldexp()
    • MathLib.log()
    • MathLib.log10()
    • MathLib.max()
    • MathLib.min()
    • MathLib.modf()
    • MathLib.pow()
    • MathLib.sin()
    • MathLib.sinh()
    • MathLib.sqrt()
    • MathLib.tan()
    • MathLib.tanh()
Casting with the JavaLib system library
In previous versions, certain arguments in certain JavaLib functions could accept a casting operator in parentheses. The migration tool changes this casting to use the syntax variable as "type":
Table 7. Changes to casts in JavaLib functions
Old code Migrated code
(byte)myVar myVar as "java:byte"
(objId)myVar myVar as "objId:java"
(null)"java.lang.Integer" null as "java.lang.Integer"
Unnecessary conversion functions
The migration tool corrects removed conversion functions. If the conversion function is part of a mathematical expression, the tool adds a cast as necessary:
Table 8. Migrated conversion functions
Old code Migrated code
result = stringAsInt(x); result = x;
result = stringAsInt(x) + 5; result = x as Int + 5;
result = stringAsFloat(x); result = x;
result = stringAsFloat(x) + 5; result = x as Float + 5;
result = stringAsDecimal(x); result = x;
result = stringAsDecimal(x) + 5; result = x as Decimal() + 5;
In the case of stringAsDecimal, you must manually enter a length for the resulting DECIMAL type.

Reference types

Initializations for reference types
The migration tool adds an initial size to new arrays:
Table 9. Changes to array initializers
Old code Migrated code
newArray string[]; newArray string[0];
The migration tool also adds an initializer to reference variable declarations without an initializer:
Table 10. Changes to console form initializers
Old code Migrated code
newForm consoleFormType; newForm consoleFormType{};
The migration tool initializes the following reference variables in this way:
  • ArrayDictionary
  • BLOB
  • CLOB
  • Record parts with the stereotype consoleForm
  • Dictionary
In a function definition that contains an array with the out modifier, the migration tool adds a new statement at the first line of the function to initialize the array. For example, assume the following function definition:
function doSomething (myParam int[] out)
  ...
end
The migration tool changes this function definition to the following definition:
function doSomething (myParam int[] out)
  myParam = new int[];
  ...
end
The migration tool makes this change only for arrays that have the out modifier.
Assignment statements for reference types
When one reference variable is assigned to another, the migration tool changes the assignment statement to a move statement to keep the behavior consistent with previous versions. In the next example the array1 and array2 variables are arrays.
Table 11. Changes to assignment statements for reference types
Old code Migrated code
array1 = array2;
move array2 to array1;
The migration tool makes this change for these types of variables:
  • Array
  • Dictionary
  • ArrayDictionary
  • Any
  • Record parts with the ConsoleForm stereotype
For assignment statements in a standalone function part, which is a function that is not within a logic part, the migration tool attempts to change assignment statements to move statements in these conditions:
  • If the migration tool can resolve both sides of an assignment statement (that is, it can determine that the variables on both sides of the assignment statement are created from a reference type), it changes the assignment statement to a move statement as it does in any function.
  • If the migration tool cannot resolve both sides of an assignment statement, the associated migration preference takes effect. In this case, if the migration preference is enabled, the tool changes the assignment statement to a move statement, as above. If the migration preference is disabled, the tool does not change the assignment statement.

Nullable variables

Expressions with null values
The migration tool changes expressions with null values to the new nullability rules; for more information, see “Changes to system libraries and variables in EGL V7.0.”
Table 12. Migration of expressions with null values
Old code Migrated code
set myVar NULL; myVar = NULL;
myVar is NULL myVar == NULL
nullable modifier
The migration tool changes the uses of the nullable modifier on function parameters to sqlNullable.
itemsNullable build descriptor option
Depending on the preferences, the migration tool adds the I4GLItemsNullable property to the following parts to replace the itemsNullable build descriptor option:
  • Program
  • Handler
  • Library
  • Record

Other statements

move statements
To preserve the default behavior of the move statement in previous versions, the migration tool adds the byName option to move statements between two record or form variables.
For statements within a standalone function, the migration tool resolves the variables on both sides of the move statement before making a change:
  • If the migration tool can resolve both sides of a move statement (that is, it can determine that the variables on both sides of the statement are records or forms), it adds byName as it does in any function.
  • If the migration tool cannot resolve both sides of the move statement, it adds withV60Compat to maintain compatibility with the previous version.
The migration tool can make this change in two cases only:
  • If it can resolve both sides of the assignment statement
  • If the associated migration preference is enabled
Changes to syntax of call, transfer, and show
The migration tool changes the uses of these statements to comply with their new syntax:
Table 13. Changes to call and transfer
Old code Migrated code
call xxx 1, 2 
    norefresh 
    externallyDefined;
call "xxx" (1, 2) 
   {IsNoRefresh = yes,
    IsExternal = yes};
transfer to program xxx 
    passing yyy 
    externallyDefined;
transfer to program "xxx" 
    passing yyy 
   {IsExternal = yes};
The migration tool makes a similar change to show statements.
in array expression
The migration tool converts statements that use in with an array to use from:
Table 14. Changes to in with an array
Old code Migrated code
if ( a in myArray[4] ) if ( a in myArray from 4 )
exit statement changes
In logic parts other than programs and standalone functions, the migration tool changes the exit program statement to exit rununit. The tool makes no change to exit statements within a program or standalone function.

Services

@WSDL and @XSD properties
The migration tool converts the @WSDL property to the @XML property and removes the @XSD property. In the process, the tool converts the elementName property field of the @WSDL property to the name property field of the @XML property. The isLastParamReturnValue property field of the @WSDL property is discarded.
Services and Service Binding Libraries
The migration tool removes the serviceBindingLibrary stereotype from Library parts.

If the preference to add web service elements to the deployment descriptor is enabled, the migration tool creates an EGL deployment descriptor in the EGLSource folder of the project and converts @EGLBinding and @WebBinding properties from the interfaces in the service binding libraries into service binding information in that deployment descriptor. The tool copies the WSDL file specified in the @WebBinding property to the EGLSource folder of the current project

If the preference to add the deployment descriptor to the build descriptors of the project is enabled, the migration tool sets the deploymentDescriptor build descriptor option to the name of the new deployment descriptor, which by default has the same name as the project.

If the preference to remove web service references from the J2EE deployment descriptor is enabled, the migration tool removes those references.

The tool updates ServiceLib.getWebEndPoint to and ServiceLib.setWebEndPoint to ServiceLib.setWebServiceLocation.

PageHandler parts

Conversion to JSFHandler parts
  • The migration tool uses the JSFHandler stereotype to change the pageHandler parts to Handler parts.
  • The tool converts the pageHandler onPageLoadFunction property to the JSF Handler onConstructionFunction property.
  • The tool adds cancelOnPageTransition = YES to all pageHandler parts that do not have this property defined.
  • In forward to URL statements and action properties, the tool changes links to pages with the extension .jsp to .faces. In forward to URL statements, the tool makes this change only if the target of the forward to URL statement is a quoted string that ends with .jsp. In uses of the action property, the tool makes this change only if the displayUse property is set to hyperlink and the action property is a quoted string that ends with .jsp. For more information file extensions of JSP files, see “Running a web page on a server.”The following tables contain examples of these changes:
    Table 15. Changes to links in pageHandlers
    Old code Migrated code
    myLink string
     {displayUse = hyperlink,
      action="myPage.jsp"};
    myLink string
     {displayUse = hyperlink,
      action="myPage.faces"};
    forward to URL "myPage.jsp";
    forward to URL "myPage.faces";
  • The tool converts value properties to initialization statements. If a variable has both a value property and an initialization statement, the migration tool uses the value of the value property, as in the following examples:
    Table 16. Changes to the value property in variables in PageHandler parts
    Old code Migrated code
    item1 string 
        { value = "item1ValueProp" } 
        = "item1Initializer";
    item1 string 
        {} = "item1ValueProp";
    item2 string 
        { value = "item3ValueProp" };    
    item2 string 
        {} = "item3ValueProp";
  • In some cases, the migration tool converts the underscore character in a variable or handler name to _005f.
JSP files
The migration tool changes JSP files that are associated with pageHandler parts to update references to variables in the JSF Handler. The tool makes these changes only if you migrate the pageHandler parts at the same time as you migrate the JSP files. These changes are in addition to the changes that occur when the migration tool migrates the pageHandler parts to JSF Handlers.
  • For JSF tags such as <h:selectOneMenu> and any <h:selectItems> or <h:selectItem> tag inside those tags, the migration tool updates the value attribute to remove the EGL prefix and any suffix, such as AsBoolean. If the resulting value attribute correctly references a variable in the JSF handler, the tool saves the changes.
    For example, assume this <h:selectOneMenu> tag:
    <h:selectOneMenu styleClass="selectOneMenu" id="menu1" 
      value="#{myPage.EGLmyComboBoxValue}">
      <f:selectItems value="#{myPage.EGLmyComboBoxChoicesAsBoolean}"/>
    </h:selectOneMenu>
    The migration tool converts this tag:
    <h:selectOneMenu styleClass="selectOneMenu" id="menu1" 
      value="#{myPage.myComboBoxValue}">
      <f:selectItems value="#{myPage.myComboBoxChoices}"/>
    </h:selectOneMenu>
    The migration tool makes this change for these tags:
    • <h:selectManyCheckboxlist>
    • <h:selectManyListbox>
    • <h:selectManyMenu>
    • <h:selectOneListbox>
    • <h:selectOneMenu>
    • <h:selectOneRadio>
    It also makes the change for <f:selectItems> and <f:selectItem> within these tags.
    The migration tool removes these suffixes:
    • AsBoolean
    • AsInteger
    • AsIntegerArray
    • AsReader
    • AsSelectItemsList
    • AsStream
    If the associated EGL variable is an array or data table column and the selectFromListItem and selectType properties are set, the migration tool makes additional changes to the value field:
    • If the selectType property is set to index, the migration tool adds the suffix _exeIdx.toArray.
    • If the selectType property is set to value, the migration tool adds the suffix .toArray.
  • Similarly, the migration tool removes the EGL prefix and suffixes such as AsBoolean from the value attribute of other tags on the page when the value attribute is in the standard expression form for EGL variables in the JSF Handler: #{beanName.variableName}. In this case, the tool also adds a binding attribute with the following value:
    #{beanName.variableName_Ref}
    Where beanName is the name of the page bean (by default, the same name as the JSF Handler) and variableName is the name of the variable that is referred to in the value attribute.
  • The migration tool updates all tags with actionListener attributes, such as those on JSF command buttons. It changes #{beanName.commandActionListener} to #{beanName._commandActionListener}.
  • For any other JSF attribute that contains an expression in the form of #{beanName.variableName}, the migration tool removes the EGL prefix and suffixes such as AsBoolean or AsInteger from the previous list.

Other parts

ConsoleForms
Because ConsoleForm parts are now generatable parts, the migration tool checks each ConsoleForm to see if its name matches the name of its file. If the file name does not match and the file name is not being used, the tool creates a new file with the name of the ConsoleForm and moves the ConsoleForm part into that new file, along with all necessary import statements. If the file name is being used, the migration tool makes no change, and you must correct your ConsoleForm parts accordingly.
Interface parts
The migration tool removes the BasicInterface stereotype from Interface parts. It also converts all Interface parts with the JavaObject stereotype to ExternalType parts.
VGUIRecord parts
The migration tool sets the following properties on VGUIRecords:
v60ExceptionCompatibility = YES, 
HandleHardIOErrors = NO, 
ThrowNrfEofExceptions = YES

Feedback