15 Understanding iJDEScript

This chapter contains the following topics:

15.1 iJDEScript

GenCOM and GenJava use a scripting language called iJDEScript that enables you to script code generation activities. Other than a few small differences, the scripting language is the same for these generators. You can use iJDEScript to:

  • Rename business function libraries or select different business functions to create a custom interface; for example:

    library MyTestLibrary

    interface MytestInterface

    import B4200310 F4211FSEditLine

    import B000042

    This example selects the single business functions B4200310 F4211FSEditLine and B000042 for exposure.

  • Use JD Edwards EnterpriseOne object aliases for more meaningful names.

  • Select business functions to expose; for example:

    library MyAnotherLibrary

    importlib CAEC

    importlib CRUNTIME 1

    This example selects all of the business functions in the CAEC and CRUNTIME 1 libraries for exposure.

iJDEScript scripts have a simple syntax:

# comments begin with # and proceed to the end of line
# whitespace is ignored
login
importlib CAEC
build

15.2 iJDEScript Commands

iJDEScript supports a standard set of commands. These commands vary slightly for GenCOM and GenJava. These variations are indicated in these command descriptions:

15.2.1 Build Command

The build command tells the generator to generate code for all defined interfaces and to build the appropriate libraries.

When the build command is complete, the interface definitions are released. Using the build command again only generates code for interfaces defined after the last build command.

15.2.1.1 Syntax

This is an example of the syntax:

build

15.2.2 Call Command

The call command tells the generator to evaluate a subroutine with the given parameters. Parameters appear within the subroutine in order as special macros named %1%, %2%, and so on.

15.2.2.1 Syntax

This is an example of the syntax:

call sub [param [...]] 

15.2.2.2 Example

This is an example:

login 
call GenerateLib CAEC 
call GenerateLib CALLBSFN 
build 
logout 

15.2.3 Define Command

The define command tells the generator to optionally define a macro expansion. The value is expanded first, and then stored as the expansion of macro name. If name already has an expansion, the generator ignores this command.

15.2.3.1 Syntax

This is an example of the syntax:

define name value 

15.2.3.2 Example

This is an example:

define val1 This is a test 
define val2 %val1%! 
define val2 This is ignored 
say %val2% 
generates the output 
This is a test 

15.2.4 Define! Command

The define! command tells the generator to define a macro expansion. The value is expanded first, and then stored as the expansion of macro name. If name already has an expansion, the generator replaces the current expansion with the new expansion.

15.2.4.1 Syntax

This is an example of the syntax:

define name value 

15.2.4.2 Example

This is an example:

define val1 This is a test 
define val2 %val1%! 
define! val2 This is not ignored 
say %val2% 
generates the output 
This is not ignored 

15.2.5 Exit Command

The exit command tells the generator to exit the current subroutine or command file.

15.2.5.1 Syntax

This is an example of the syntax:

exit 

15.2.6 Help Command

The help command requests help information from the generator on all available commands. Syntax information and a brief description are presented for each command. If command is specified, only help for command is provided.

15.2.6.1 Syntax

This is an example of the syntax:

help [command] 

15.2.7 Import Command

The import command tells the generator to retrieve the specification of a function or group of business functions from the database and add them to the current interface definition. If only the business function name is specified, all functions from the specified business-function are retrieved and added to the current interface definition. If a function name is specified, only that function is retrieved and added to the current interface definition.

The alias option enables you to rename the function within the interface definition. The implementation still uses the original name when invoking the business function; however, the function is exposed as name through the interface.

15.2.7.1 Syntax

This is an example of the syntax:

import business-function [function [alias name]] 

15.2.7.2 Example

This is an example:

library General 
interface ReleaseMgmt 
# Load GetReleaseAndVersion from B9800890; call it GetRV in 
# ReleaseMgmt 
import B4200310 F4211FSEditLine alias GetRV 
# Load all functions from B000042 
import B000042 

15.2.8 Importlib Command

The importlib command tells the generator to import all business functions from the specified JD Edwards EnterpriseOne library, such as CAEC or CALLBSFN, into the current library definition. Each business function group results in the definition of an interface with the same name as the business function group and exposes as methods the functions within that group.

The category parameters enables you to restrict the import to one or more specific categories (1, 2, 3 and -; see the /Cat command line option).

15.2.8.1 Syntax

This is an example of the syntax:

importlib library [category [...]] 

15.2.8.2 Example

This is an example:

library JDECOMInterfaceCAECCat1 
# Load all category 1 functions from CAEC 
importlib CAEC 1 
build 

15.2.9 Interface Command

The interface command tells the generator to begin the definition of an interface. All business functions retrieved using subsequent import commands become members of this interface.

15.2.9.1 Syntax for COM

This is an example of the syntax:

interface interface [ProgID prog-id] [vi-prog-id] 

15.2.9.2 COM Example

This is an example:

interface ReleaseMgmt ProgID SOA.ReleaseMgmt.5 SOA.ReleaseMgmt 
import B4200310 F4211FSEditLine 

15.2.10 Library Command

The library command tells the generator that subsequent interface and import commands will generate definitions that belong in the library (DLL) named name. If the parameterset tag is also supplied, the library is used solely for parameterset definitions.

Note:

When the library command without the parameter set tag is evaluated, parametersets for subsequent interface and import commands appear in that library until a library command with the parameterset tag is evaluated.

15.2.10.1 Syntax

This is an example of the syntax:

library name [parameterset] 

15.2.10.2 Example

This is an example:

library Lib1 
library Lib1Params parameterset 
# Parametersets for CALLBSFN go in Lib1Params, but the 
# business function interfaces go in Lib1 
importlib CALLBSFN 2 3 

15.2.11 Login Command

The login command tells the generator to log on to JD Edwards EnterpriseOne. If user, password, environment, and role are not specified, the user is prompted for the information.

15.2.11.1 Syntax

This is an example of the syntax:

login [user password environment role] 

15.2.11.2 Example

This is an example:

login me mypassword demo 

15.2.12 Logout Command

The logout command tells the generator to log off of JD Edwards EnterpriseOne.

15.2.12.1 Syntax

This is an example of the syntax:

logout 

15.2.13 Opt Command

The opt command tells the generator to set the value of a generator command line parameter. The option parameter should not begin with the usual /. The value parameter does not undergo macro expansion.

15.2.13.1 Syntax

This is an example of the syntax:

opt option value 

15.2.13.2 Example

This is an example:

# Do not generate business function interfaces, only 
# parameterset interfaces 
opt NoBSFN 

15.2.14 Rename Command

The rename command tells the generator to rename an interface or a method within an interface. If a method is renamed, the correct business function is still called to build the implementation, but the method is exposed through the interface with a different name.

15.2.14.1 Syntax

This is an example of the syntax:

rename interface new 
rename interface method new 

15.2.14.2 Example

This is an example:

library Lib1 
importlib CALLBSFN 
rename B000042 BatchControl 
rename BatchControl FSOpenBatch Open 
rename BatchControl FSCloseBatch Close 

15.2.15 Say Command

The say command tells the generator to display a message on the console.

15.2.15.1 Syntax

This is an example of the syntax:

say message 

15.2.15.2 Example

This is an example:

say This is a test (%OwRelease%) 
generate the output 
This is a test (B9) 

15.2.16 Sub Command

The sub command creates a subroutine definition. The call command may be used to invoke the subroutine. Parameters passed to the subroutine are as special macros named %1%, %2%, and so on.

15.2.16.1 Syntax

This is an example of the syntax:

sub name 
   commands 
end 

15.2.16.2 Example

This is an example:

sub GenerateLibrary 
      define source %1% 
      library JDECOMInterface%source%Cat1 
   importlib %source% 1 
# Create a library of category 2 business functions in source 
      opt NoBSFN 
      library JDECOMInterface%source%Cat2 
      importlib %source% 2 
# Create a library of category 3 business functions in source 
      library JDECOMInterface%source%Cat3 
      importlib %source% 3 
      system del /q c:\temp\*.* 
      build 
# Move the libraries to a staging area 
      system mkdir d:\build 
      system mkdir d:\build\Cat1 
   system mkdir d:\build\Cat2 
   system mkdir d:\build\Cat3 
   system move JDECOMInterface%source%Cat1.* d:\build\Cat1 
   system move JDECOMInterface%source%Cat2.* d:\build\Cat2 
   system move JDECOMInterface%source%Cat3.* d:\build\Cat3 
end 
call GenerateLibrary CAEC 

15.2.17 System Command

The system command tells the generator to evaluate a command in the shell.

15.2.17.1 Syntax

This is an example of the syntax:

system command 

15.2.17.2 Example

This is an example:

say This is a test 
generates the output 
This is a test