BasicLibrary stereotype

The BasicLibrary stereotype identifies a Library part that contains EGL-written functions and values for runtime use in other EGL logic parts.

The following rules apply to a BasicLibrary:
  • Any main logic part (Program, Service, Handler, or another Library) can reference the functions, variables, and constants of a Library without specifying the Library name if that logic part includes the Library in a use statement.
  • Library functions cannot include the following statements:
    • converse
    • display
    • forward
    • show
    • transfer
  • You can use the private modifier on a function, variable, or constant declaration to keep the element from being used outside of the Library. You might do this when the element is used only by a function within the Library.
  • Public Library functions (the default) are available outside of the Library and cannot have loose type parameters. A loose type is a special case of primitive type that is available only if you want the parameter to accept a range of argument lengths. For more information, see Loose types.
The following example shows a BasicLibrary part:
package com.companyb.customer;

Record CustomerRecord type SQLRecord
  customerNumber CHAR(6);  
  customerName CHAR(25);   
  customerBalance BIN(9,2); 
end  

Library CustomerLibrary type BasicLibrary

  // Function Declarations
  function getCustomerName(
    myCustomerNumber CHAR(6) in,
    myCustomerName CHAR(25) inOut)

    myCustomer CustomerRecord;
    myCustomer.customerNumber = myCustomerNumber;
    get myCustomer;
    myCustomerName = myCustomer.customerName;
  end

end