This chapter contains the following topics:
GenCOM uses a scripting language called iJDEScript that enables you to script code generation activities. 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
iJDEScript supports a standard set of commands.
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 generates code for interfaces defined after the last build command.
This is an example of the syntax:
build
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.
This is an example of the syntax:
call sub [param [...]]
This is an example:
login
call GenerateLib CAEC
call GenerateLib CALLBSFN
build
logout
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.
This is an example of the syntax:
define name value
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
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.
This is an example of the syntax:
define name value
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
The exit command tells the generator to exit the current subroutine or command file.
This is an example of the syntax:
exit
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.
This is an example of the syntax:
help [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.
This is an example of the syntax:
import business-function [function [alias name]]
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
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 enable you to restrict the import to one or more specific categories (1, 2, 3 and -; see the /Cat command line option).
This is an example of the syntax:
importlib library [category [...]]
This is an example:
library JDECOMInterfaceCAECCat1
# Load all category 1 functions from CAEC
importlib CAEC 1
build
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.
This is an example of the syntax:
interface interface [ProgID prog-id] [vi-prog-id]
This is an example:
interface ReleaseMgmt ProgID SOA.ReleaseMgmt.5 SOA.ReleaseMgmt
import B4200310 F4211FSEditLine
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.This is an example of the syntax:
library name [parameterset]
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
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.
This is an example of the syntax:
login [user password environment role]
This is an example:
login me mypassword demo
The logout command tells the generator to log off of JD Edwards EnterpriseOne.
This is an example of the syntax:
logout
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.
This is an example of the syntax:
opt option value
This is an example:
# Do not generate business function interfaces, only
# parameterset interfaces
opt NoBSFN
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.
This is an example of the syntax:
rename interface new
rename interface method new
This is an example:
library Lib1
importlib CALLBSFN
rename B000042 BatchControl
rename BatchControl FSOpenBatch Open
rename BatchControl FSCloseBatch Close
The say command tells the generator to display a message on the console.
This is an example of the syntax:
say message
This is an example:
say This is a test (%OwRelease%)
generate the output
This is a test (B9)
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.
This is an example of the syntax:
sub name
commands
end
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