12 Creating Business Services

This chapter contains the following topics:

12.1 Understanding Business Services

Published business services are Java classes that manage and run business services. Business services are Java classes that have one or more methods. Business service methods call business functions, database operations, and other business services to provide a specific, described unit of work. Business service methods cannot be exposed as web services for public consumption; instead, business service methods are called by the published business service methods. The published business service methods can be exposed as a web service. JD Edwards provides reference implementations that show how to create both published business services and business services. You can use the reference implementations as models for creating your own services. The reference implementations are not intended for production; they are for reference only.

You might need to add functionality to an existing published business service. You can do this by creating a new business service that performs the task that you require. After you create a new business service, you need to create a new published business service that calls the business service. As an alternative to creating a new business service, you can create a version of the business service and include the new functionality. Creating business service versions is discussed in the methodology guide.

See "Versioning JD Edwards EnterpriseOne Web Services" in the JD Edwards EnterpriseOne Tools Business Services Development Methodology Guide.

The concept of value objects is important for understanding JD Edwards EnterpriseOne business services. Value objects are Java classes that manage data. Each published business service method works with two value object classes, an input value object class, and an output value object class. The input and output data are the payload of the web service.

Business service methods use internal value objects. These internal value objects are not published interfaces. A business service method uses one internal value object for both input and output data. The methodology guide provides an overview of value objects for both published business services and business services.

To help you create the Java classes, JDeveloper provides these wizards:

  • Published Business Service Class Wizard.

  • Business Function Value Object Class Wizard.

  • Database Value Object Class Wizard.

  • Business Service Class Wizard.

Each of the wizards takes you through a series of steps, prompting you for information or prompting you to select an item. When you complete the series of steps, the wizard generates code that is stored as a Java file in the project that you selected before you started the wizard. The code that the wizard generates is displayed in the JDeveloper edit pane. The generated code has TODO tags to help you complete it. JDeveloper also provides visual aids, such as icons on the left-hand side of the editor and colored indicators on the right-hand side of the editor, to help you complete the code.

The first time that you launch a JDeveloper wizard within a user session, the authentication page appears. If credentials are configured, the authentication page opens with that information. You can overwrite the default credentials.

You can have a published business service class or business service class that contains more than one method. However, the Published Business Service Class Wizard and the Business Service Class Wizard create code for only one method. You add additional methods at the end of the protected method created by the wizard by applying a code template or by copying and pasting the method created by the wizard. This table identifies the code templates that are available in JDeveloper for you to use with JD Edwards EnterpriseOne business services:

Template Name Usage
E1DF JD Edwards EnterpriseOne Data Formatter Use when creating a business service to generate code that formats data that comes from the published value object.
E1JD JD Edwards EnterpriseOne Java Doc for Published Members Use when creating a published value object class to generate code for creating Javadoc.
E1JDI JD Edwards EnterpriseOne Java Doc for Internal Members Use when creating a value object class to generate code for Javadoc.
E1PM JD Edwards EnterpriseOne Published Business Service Method Call Use when adding a method to a published business service to generate code for the new public and private methods.
E1SC JD Edwards EnterpriseOne Configure Web Service Proxy with Soft Coding Record Use when creating a business service that calls an external web service to generate code for configuring the web service proxy with a softcoding record.
E1SD JD Edwards EnterpriseOne Add Call to Service Property with Default Value Use when creating a business service to generate code to call a service property.
E1SM JD Edwards EnterpriseOne Business Service Method Call Use when adding a method to a business service class to generate code for the new method.
E1TEST JD Edwards EnterpriseOne Test Harness Class Use when creating a test harness main method to test a published business service class.

You access a code template within the Java code. You place your cursor where you want to create the generated code and press Ctrl+Enter. A list of code templates is displayed on a context menu. Select the appropriate template from the list to generate the code.

See Also:

12.1.1 Prerequisites

Before you complete the tasks in this section, verify that:

  • JD Edwards EnterpriseOne is installed and running.

  • The MTR version of JDeveloper is installed and running.

  • JDeveloper is launched from Object Management Workbench (OMW).

  • You do not use JDK 1.6 specific APIs in your business logic if you want to develop business services for OAS, WAS, and WebLogic all together.

12.1.2 Common Elements Used in This Chapter

Back Button

Click this button to return to a previous wizard page. A Back button is on all pages of any JD Edwards EnterpriseOne wizard that you run from JDeveloper.

Cancel Button

Click this button to cancel your entries and to close the wizard. A Cancel button is on all pages of any JD Edwards EnterpriseOne wizard that you run from JDeveloper.

Description

Enter text that describes the JD Edwards EnterpriseOne business function, table, or business view.

Environment

Enter the name of the JD Edwards EnterpriseOne environment in which you are working.

Finish Button

When you click this button, the wizard processes your request, closes the wizard, and returns you to JDeveloper. The Finish button is on all pages of any JD Edwards EnterpriseOne wizard that you run from JDeveloper. This button is unavailable until you have responded to all wizard requests.

Function Name

Enter the name of the business function. On wizard search pages, you can use wildcards when searching for a name, for example, *JDE*.

Help Button

Click this button to access the help feature. A Help button is on all pages of any JD Edwards EnterpriseOne wizard that you run from JDeveloper.

Library

The DLL in JD Edwards EnterpriseOne to which a business function belongs. The library name consists of the DLL name and functional group.

Module/Object Name

The OMW object name of the business function, table, or business view.

Next Button

Click this button to go to the next wizard page. The Next button is on all pages of any JD Edwards EnterpriseOne wizard that you run from JDeveloper.

Object Type

A category that allows you to select either a JD Edwards EnterpriseOne table or business view as a search option. If you completed the Object Name field, you must select the object type that is consistent with the object name. For example, if you typed FO* in the Object Name field, you must select Table as your object type. If you typed V0* in the Object Name field, you must select business view as your object type.

Password

Enter your JD Edwards EnterpriseOne password.

Reporting System Code

A user-defined code (UDC) that identifies a system or product. This code often is the same as the system code and is used for reporting purposes. On wizard search pages, you can use wildcards when searching for a reporting system code, for example, H*.

Role

Enter your JD Edwards EnterpriseOne role.

System Code

A JD Edwards EnterpriseOne-defined code that identifies a system or product, for example, 42 for Sales Order. On wizard search pages, you can use wildcards when searching for a system code, for example, 4*.

System Code and Product code are used interchangeably.

User Name

The valid name of the individual who is accessing JD Edwards EnterpriseOne.

12.2 Adding JDeveloper Projects for Business Services

This section provides an overview of JDeveloper projects for business services and discusses how to add a new project for JD Edwards EnterpriseOne.

12.2.1 Understanding JDeveloper Projects for Business Services

You access JDeveloper from JD Edwards EnterpriseOne OMW. You should have one business service workspace in JDeveloper. This workspace should have been created when JDeveloper was launched from OMW. Each published business service and business service has its own project under the business service workspace, where you can add and modify code for published business services and business services that were created using OMW. The JDeveloper project name matches the business service name in OMW. Naming conventions for JD Edwards business service classes are discussed in the Development Methodology Guide. When you create new business services, you develop each published business service and business service within its own project in JDeveloper. A JDeveloper workspace can have many projects.

When you are in OMW, you can create more than one business service object. When you launch JDeveloper, it is launched for a specific business service object, and only the JDeveloper project for that business service is added to the workspace. You can add additional JDeveloper projects for other business services by closing JDeveloper and relaunching it from OMW for other business services or by choosing New EnterpriseOne Project from the workspace context menu. Business services must be added in OMW prior to working with them in JDeveloper.

Sample business services that you can use as a reference for implementing your business services are included in your software delivery. You use OMW and JDeveloper to review the code for these reference implementations, as you would for any other business service.

See Also:

12.2.2 Adding a New Project

To add a new project for a business service:

  1. Access the business service workspace in JDeveloper

  2. In the navigation pane, right-click the workspace name.

  3. From the context menu, click New EnterpriseOne Project.

  4. Type the existing OMW project name, and then click Finish.

  5. Save the file.

The business service that you previously created in OMW appears in the JDeveloper navigation pane under the business services workspace. The project has a package name—the package prefix is the prefix specified in OMW and the last portion of the package name is the OMW object name. Any Java classes or other artifacts associated with that business service object is included as a part of the JDeveloper project.

12.3 Creating Published Business Service Classes

This section provides an overview of published business service classes and discusses how to run the Published Business Service Class Wizard.

12.3.1 Understanding Published Business Service Classes

Published business services are exposed as web services for public consumption. You can create a published business service to meet your specific needs. A published business service is composed of one or more business services, which perform specific tasks. The methodology guide provides naming conventions as well as instructions and guidelines for creating new published business services.

You use the Published Business Service Class Wizard to create the published business service Java class.

12.3.2 Running the Published Business Service Class Wizard

The Published Business Service Class Wizard creates a new published business service class by extending the business service framework PublishedBusinessService class. This foundation class, along with other business service framework foundation classes, provides the building blocks for you to create a new published business service class.

The wizard steps you through a series of tasks, prompting you for information for naming the class, the method, the input value object, and the output value object. As a final step, the wizard generates Java code for the published business service class and displays this generated code in the edit pane of JDeveloper.

You can use the prompts, visual aids, and TODO tags to complete the generated code. As previously discussed, JD Edwards EnterpriseOne provides code templates that you can apply to the generated code. If the published business service requires more than one method, you must add code for each additional method.

To run the Published Business Service Class Wizard:

  1. In the JDeveloper navigation pane, select the project.

  2. Right-click the project.

  3. From the context menu, click New.

  4. On the new Gallery window, open EnterpriseOne and select Classes, and then select Published Business Service Class.

  5. Click OK to launch the wizard.

  6. On the Create EnterpriseOne Published Business Service Class page, complete these fields:

    • Name

    • Method Name

    • Input Class

    • Return Class

  7. Click OK.

    JDeveloper displays the generated code in the edit pane.

  8. Update the generated code.

  9. From the JDeveloper File menu, save and exit the code.

    The published business service class is saved in the project that you selected. You can open the class and the code by double-clicking the Java file.

Name

A user-defined designation for the published business service class. This name is usually the description name of the system code with Manager added at the end of the name, for example, AddressBookManager.

Method Name

A user-defined designation for a business service. In the published business service, the method name is the same name as the business service name that is called.

Input Class

A user-defined designation for the input value object class for the published business service. Each business service or business method called by the published business service must have an input class in the published value object.

Return Class

A user-defined designation for the output value object class for the published business service. Each business service or business method called by the published business service must have an output class in the published value object.

12.4 Creating Value Object Classes

This section provides an overview of value object classes and discusses how to:

  • Run the Business Function Value Object Wizard.

  • Run the Database Operation Value Object Wizard.

12.4.1 Understanding Value Object Classes

Value objects are Java classes that manage data. The input and output parameters of the published business service methods are called value objects. These parameters are the payload of the web service. A method defined in a published business service takes one value object as its input parameter and returns one value object as its output parameter. The input and output parameters of business service operations are called internal value objects. Business service internal value objects are not published interfaces. Business service operations use one internal value object for both input and output.

The business service foundation provides wizards to help you create value object classes that follow methodology rules and guidelines. You use the Business Function Value Object Wizard to create value objects that are based on data structures defined within a business function. You use the Database Operation Value Object Wizard to create value objects that are based on database tables or business views for database operations.

The methodology guide provides naming conventions as well as rules and guidelines for creating published value object classes and internal value object classes.

12.4.2 Running the Business Function Value Object Class Wizard

You use the Business Function Value Object Wizard to create value objects that are based on data structures defined within a business function.

The Business Function Value Object Wizard guides you through a series of tasks to create value objects based on a business function data structure. You use the wizard to search for and find an existing business function to use as a model. The business function that you select should have all of the input and output parameters that are required for your new value object. You can select all or some of the business function parameters to include in your value object class. At the end of the process, the wizard generates code for the value object.

If you are creating a published business service, each business service method must have an input value object and an output value object. If a published business service calls two or more business services that have the same input or output parameters, the business services can share the appropriate input or output value object.

The wizard provides different ways for you to find an existing business function. On the wizard search page you can use the Find button to return all business functions in JD Edwards EnterpriseOne. You can scroll through all of the business functions and select one. If you have some information about the business function that you want to use, you can enter information in one or more of the search fields to filter the search. You can use wildcards in the search fields. For example, if you know the business function name has a 4 in it, you can use *4* in the Object Name field. If you know the name of the business function, you can use the Advanced Search feature to find the business function.

To run the Business Function Value Object Class Wizard:

  1. In the JDeveloper navigation pane, select the project.

  2. Right-click the project.

  3. From the context menu, click New.

  4. On the New Gallery window, open EnterpriseOne and select Classes, and then select Business Function Value Object Class.

  5. Click OK to launch the wizard.

  6. On the Create EnterpriseOne Business Function Value Object, click Next.

  7. Enter credential information if required, and then click Next.

  8. On the wizard search page, find a business function by performing one of the following actions:

    • If you do not have any information about the business function, click Find to list all business functions and scroll through the list. Select a business function and then click Next.

    • If you have some information about the business function you want to use, complete one or more of these search fields to filter the list of business functions, and then click Find.

      – Object Name

      – System Code

      – System Code

      – Function Name

      – Reporting System Code

      – Description

      – Library

      You can use wildcards in any of these search fields.

      Select a business function from the search results, and then click Next.

    • If you know which business function you want to use, click Advanced Find.

      Using the drop-down list box, select the appropriate information for each of these fields, and then click Next:

      – Library

      – Module/Object Name

      – Function Name

  9. The next page of the wizard opens showing the attributes of the business function that you selected.

    You can sort the names of the parameters by clicking the Name column.

  10. Select the parameters that you want to include in your new value object class, and then click Next.

    You can select parameters individually by selecting the Include check box in the same row as the parameter that you want. When you select parameters individually, you can display the parameters that you selected by selecting the Display Select Only option. If you want to include all of the parameters in your value object, use the Select All button. Use the Clear All button to clear your selections and start over.

  11. On the EnterpriseOne Java Class wizard page, enter the name of the value object that you are creating in the Value Object Name field.

    Value object classes for business services should have the same name as the published business service value object name (input or output) prefaced with the word Internal.

  12. Select one of these Scope options:

    • Publish - if you are creating a value object class for a published business service.

    • Internal - if you are creating a value object class for an internal business service.

  13. Click Finish.

    If the name that you entered for the value object already exists, the wizard sends you a warning message. If the name is a new name, the value object Java file appears in the JDeveloper navigation pane under the project that you selected. Generated code is displayed in the JDeveloper edit pane.

  14. Use the visual aids and TODO tags to help you complete the generated code.

  15. To create accessors for the members in the value object Java file, right-click anywhere in the generated code.

  16. From the context menu, select generate accessors.

    The Generate Accessors dialog window appears.

  17. To select all members, click on the top-level check box.

  18. Click OK.

  19. Save the value object Java file.

12.4.3 Running the Database Operation Value Object Wizard

You use the Database Operation Value Object Wizard to create value objects that are based on database tables or business views. The Database Operation Value Object Wizard guides you through a series of tasks to create value objects based on a database schema. You use the wizard to search for and find an existing table or business view. The table (business view) that you select should have all of the fields that are required for your new value object class. The wizard automatically selects all of the key fields in the table (business view). At the end of the process, the wizard generates code for the value object class and displays the code in the JDeveloper edit pane.

If you are creating a published business service, you run the wizard twice, once to create an input value object class and once to create an output value object class. If the published business service has more than one method, you run the wizard twice for each method. If you are creating a business service, you run the wizard once to create the internal value object, which has both input and output parameters. If the business service has more than one method, you run the wizard multiple times to create an internal value object for each method.

The wizard provides three ways for you to find an existing table (business view). On the wizard search page, you select either the Table or Business View option. You can use the Find button to return all tables or business views in JD Edwards EnterpriseOne, and then scroll through the results and select one. If you have some information about the table or business view that you want to use, you can enter information in one or more of the search fields to filter the search. You can use wildcards in the search fields. For example, if you know the object name has a 4 in it, you can use *4* in the Object Name field. Scroll through the results and select the appropriate table or business view. If you know the name of the table or business view, you can use the Advanced Search feature to find the table or business view.

The methodology guide provides rules and guidelines for creating published value objects and internal value objects for each type of database operation (Select, Insert, Update, and Delete). Naming conventions for the value object classes for both published business service and business service are discussed by database operation type.

To create a database value object:

  1. In the JDeveloper navigation pane, select the project.

  2. Right-click the project.

  3. From the context menu, click New.

  4. On the New Gallery window, open EnterpriseOne and select Classes, and then select Database Value Object Class.

  5. Click OK to launch the wizard that creates a value object class.

  6. On the Create EnterpriseOne Database Value Object Class, click Next.

  7. Enter credential information if required, and then click Next.

  8. On the wizard search page, select one of these object types:

    • Table

    • Business View

  9. Find a table (business view) by performing one of the following actions:

    • If you do not have any information about the table (business view), click Find to list all tables (business views) and scroll through the list. Select a table (business view).

    • If you have some information about the table (business view) that you want to use, complete one or more of these search fields to filter the search, and then click Find:

      – Object Name

      – System Code

      – Description

      – Reporting System Code

      You can use wildcards in any of these search fields.

      Select a table (business view) from the search results, and then click Next.

    • If you know which table (business view) you want to use, click Advanced Find.

      Using the drop-down list box, select the appropriate information for each of these fields, and then click Next:

      – Object Type

      – Object Name

  10. The next page of the wizard opens showing the attributes of the table (business view) that you selected.

  11. Select the parameters that you want to include in your new value object class, and then click Next.

    You can select parameters individually by selecting the Include check box in the same row as the parameter that you want. When you select parameters individually, you can display only the parameters that you selected by selecting the Display Select Only option. If you want to include all of the parameters in your value object, use the Select All button. Use the Clear All button to clear your selections and start over.

  12. On the EnterpriseOne Java Class page, enter the name of the value object that you are creating in the Value Object Name field.

  13. Select one of these Scope options:

    • Publish – if you are creating a value object class for a published business service.

    • Internal – if you are creating a value object class for an internal business service.

  14. Click Finish.

    If the name you entered for the value object already exists, the wizard sends you a warning message. If the name is a new name, the value object Java file appears in the JDeveloper editor under the project that you selected.

  15. JDeveloper displays the generated code in the edit pane.

  16. Use the visual aids and TODO tags to help you complete the generated code.

  17. To create accessors for the members in the value object Java file, right-click anywhere in the generated code.

  18. From the context menu, select generate accessors.

    The Generate Accessors dialog window appears.

  19. To select all members, click the top-level check box.

  20. Click OK.

  21. Save the value object Java file.

See "Database Exceptions" in the JD Edwards EnterpriseOne Tools Business Services Development Methodology Guide.

12.5 Creating Business Service Classes

This section provides an overview of business service classes and discusses how to run the Business Service Class Wizard.

12.5.1 Understanding Business Service Classes

Business service classes are internal only. A business service method provides the business logic for performing a specific task and is exposed to the public by being included in a published business service. A business service method can call one or more business functions or database operations to perform a specific task, and it can call another business service. The methodology guide provides naming conventions as well as rules and guidelines for creating business services.

You use the Business Service Class Wizard to create the business service class.

12.5.2 Running the Business Service Class Wizard

The Business Service Class Wizard creates a new business service class by extending the business service framework BusinessService class. This foundation class, along with other framework foundation classes, provides the building blocks for you to create a new business service class.

The wizard steps you through a series of tasks, prompting you for information for naming the class, the method, and the internal value object. As a final step, the wizard generates code for the business service class and displays this code in the edit pane of JDeveloper.

JDeveloper provides prompts and visual aids help you complete the generated code. The generated code also has TODO tags to help you. If the business service class requires more than one method, you must add code for each additional method. JD Edwards EnterpriseOne provides code templates that you can apply to the generated code. The methodology guide provides naming conventions for the various elements of the business service, and it also provides detail guidance for creating a business service.

To run the Business Service Class Wizard:

  1. In the JDeveloper navigation pane, select the project.

  2. Right-click the project.

  3. From the context menu, click New.

  4. On the New Gallery window, open EnterpriseOne and select Classes, and then select Business Service Class.

  5. Click OK to launch the wizard.

  6. On the Create EnterpriseOne Business Service Class, complete these fields:

    • Name

    • Method Name

    • Input Class

  7. Click OK.

    JDeveloper displays the generated code in the edit pane.

  8. Update the generated code.

  9. From the JDeveloper File menu, save and exit the code.

The business service class is saved in the project you selected. You can open the class and the code by double-clicking the Java file.

Name

Enter a user-defined designation for the business service class. This name is usually a functional description of the method with the word Processor added at the end of the name, for example, AddressBookProcessor.

Method Name

Enter a user-defined designation for the operation to be performed. This name is usually the same name as the method in the published business service, for example, addAddressBook.

Input Class

Enter the class name for the internal value object.

12.6 Creating Business Function Calls

This section provides an overview of business function calls and discusses how to run the Create Business Function Call Wizard.

12.6.1 Understanding Business Function Calls

A business service method contains the business logic for performing a specific task in JD Edwards EnterpriseOne. You create a business service method that calls a business function. You use the Create Business Function Call Wizard to create a business function call and the accompanying code. The business service method must exist before you can use the Create Business Function Call Wizard.

The methodology guide provides rules and guidelines for creating business services.

12.6.2 Running the Create Business Function Call Wizard

The business service framework provides a Create Business Function Call Wizard that generates Java code for calling a business function. You create a business function call in the code already created by the Create Business Service Wizard. You must be at an appropriate location within the code to create the business call method. A TODO tag should be available to help you find this location. The Create Business Function Call Wizard helps you select a business function to use for creating your new business function call.

To run the Create Business Function Call Wizard:

  1. Open the Java file for the business service.

  2. In the JDeveloper editor pane, place the cursor at a valid position for inserting the Java logic.

  3. From the context menu, select EnterpriseOne, and then select Create Business Function Call.

    If Create Business Function Call is disabled on the context menu, the cursor is not at a valid position in the code.

  4. The Business Function Call Wizard is launched.

  5. Click Next.

    If the authentication page appears, enter your credentials, and then click Next.

  6. On the wizard search page, find an existing business function by performing one of the following actions:

    • If you do not have any information about the business function, click Find to list all business functions and scroll through the list. Select a business function and then click Next.

    • If you have some information about the business function you want to use, complete one or more of these search fields to filter the list of business functions, and then click Find.

      – Object Name

      – System Code

      – Function Name

      – Reporting System Code

      – Description

      – Library

      You can use wildcards in any of these search fields.

      Scroll through the results to find a business function. If the Next Page button is active, click it to see additional results, which are added to the bottom of the list, and continue to scroll.

      If you use the Find button to find a business function, select a business function from the search results and then click Next.

    • If you know which business function you want to use, click Advanced Find.

      Using the drop-down list box, select the appropriate information for each of these fields, and then click Next:

      – Library

      – Module/Object Name

      – Function Name

  7. The next page of the wizard opens showing the attributes of the business function that you selected.

  8. Select the parameters that you want to include in your new value object class.

    You can select parameters individually by selecting the Include check box in the same row as the parameter that you want. When you select parameters individually, you can display the parameters that you selected by selecting the Display Select Only option. If you want to include all of the parameters in your value object, use the Select All button. Use the Clear All button to clear your selections and start over.

  9. Click Finish.

    The Java code is updated with the business function call and accompanying code, which you must complete.

12.7 Creating Database Operation Calls

This section provides an overview of database operation calls and discusses how to:

  • Run the Create Database Call Wizard.

  • Create a Select Database Operation Call.

  • Create an Insert Database Operation Call.

  • Create an Update Database Operation Call.

  • Create a Delete Database Operation Call.

12.7.1 Understanding Database Operation Calls

You can create business services that call select, insert, update, and delete database operations. A select operation retrieves information from JD Edwards EnterpriseOne. Select and query database operations are synonymous. An insert operation adds information to a JD Edwards EnterpriseOne table or business view. An update operation modifies existing information in a JD Edwards EnterpriseOne table or business view. A delete operation removes information from a JD Edwards EnterpriseOne table or business view. You can create a select operation to directly query against the JD Edwards EnterpriseOne tables and business views.

12.7.2 Running the Create Database Call Wizard

The business services framework provides a Create Database Call Wizard that generates Java code for calling a database operation. You create a database call in the code already created by the Create Business Service Wizard. You must be at an appropriate location within the code to create the database call method. A TODO tag should be available to help you find this location. The Create Database Call Wizard helps you select a table or business view to use for your new database operation call. After you launch the wizard, it displays a page that has the following database operations:

  • Select

  • Insert

  • Update

  • Delete

After you select the type of database operation you want to use, the wizard helps you search for a table or business view to use in your database operation call. The wizard then guides you through a series of steps prompting you for information.

After you specify the appropriate information, the wizard creates a conceptual SQL statement that you can preview. If the SQL statement does not show what you need, you can return and change your specifications. When you are satisfied with your selections, the Database Call Wizard generates the call and accompanying code, which is unique for the database operation that you selected.

The Create Database Call Wizard allows the data types and operations identified in this table:

Data Type Data Type Shown in Wizard Allowed Operators
EVDT_CHAR Character =, >, >=, <, <=, <>
EVDT_JDEDATE Date =, >, >=, <, <=, <>
EVD_INT Integer =, >, >=, <, <=, <>
EVDT_LONGVARCHAR Character (BLOB) Not allowed in WHERE clause
EVDT_LONGVARBINARY Binary (BLOB) Not allowed in WHERE clause
EVDT_STRING String =, >, >=, <, <=, <>, LIKE If size is greater than 255, Oracle database treats as a BLOB, which is not allowed in WHERE clause
EVDT_VARSTRING Variable String Not allowed in WHERE clause
EVDT_JDEUTIME JDE Utime =, >, >=, <, <=, <>
EVDT_MATH_NUMERIC Numeric =, >, >=, <, <=, <>
EVDT_ID Identifier (ID) =, >, >=, <, <=, <>

To run the Database Call Wizard:

  1. Open the Java file for the business service.

  2. In the JDeveloper editor pane, place the cursor at a valid position for inserting the Java method.

  3. From the context menu, select EnterpriseOne, and then select Create Database Call.

    If Create Database Call is disabled on the context menu, the cursor is not at a valid position in the code.

  4. Click Next.

  5. On the Create EnterpriseOne Database Call introduction window, click Next.

    If the authentication page appears, enter your credentials, and then click Next.

  6. On the Select a Database Operation page, select a database operation and then click Next.

  7. On the wizard search page, select one of these object types:

    • Table

    • Business View

  8. Find a table (business view) by performing one of the following tasks:

    • If you do not have any information about the table (business view), click Find to list all tables (business views) and scroll through the list. Select a table (business view).

    • If you have some information about the table (business view) you want to use, complete one or more of these search fields to filter the search, and then click Find:

      – Object Name

      – System Code

      – Description

      – Reporting System Code

      You can use wild cards in any of these search fields.

      Select a table (business view) from the search results, and then click Next.

    • If you know which table (business view) you want to use, click Advanced Find.

      Using the drop-down list box, select the appropriate information for each of these fields, and then click Next:

      – Object Type

      – Object Name

  9. The next page of the wizard opens showing the operation that you selected along with the attributes of the table (business view) that you selected.

  10. Depending on the database call operation you are creating, go to one of these tasks in this guide:

    • Create a Select database operation.

    • Create an Insert database operation.

    • Create an Update database operation.

    • Create a Delete database operation.

12.7.3 Creating a Select Database Operation Call

If you selected the Select Database Operation, the wizard opens the Select Operation main page and displays the attributes of the table (business view) that you selected for the Select operation. The Select operation main page has three tabs: Select Columns, Where Clause, and Order by Columns.

12.7.3.1 Select Columns Tab

The Select Columns tab shows all of the columns that are available in the table or business view that you selected. Each column from the table (business view) is displayed as a row, and includes the column name, description of the column, and column type, and indicates whether the column is a primary key. You can sort the rows by clicking in any of the column headers. For example, when you click the column header Column Name, you can sort the rows in ascending, descending, or default order by column name.

From the table (business view), you select the columns that you want to use in your Select database operation. You can select specific columns by selecting the check box in the appropriate row, or you can select all of the columns by clicking the Select All button. If you did not select all columns, you can select the Display Selected Only option to show those columns that you selected. You can clear all of your selections by clicking the Clear All button.

The Fetch All Records option and Select Distinct option are used by the system at runtime. The Fetch All Records option works with tables and business views and fetches all records that meet the search criteria. The Select Distinct option works with both tables and business views, but is more commonly used with business views. When many records meet the search criteria, you can use the Select Distinct option to select only one record for the search criteria instead of selecting all of the records. If you do not select this option, then the system returns all occurrences of these records, including all detail lines.

12.7.3.2 Where Clause Tab

You use the where clause to filter the data for your Select database operation. You can set conditions for one or more of the column names that you have selected. To add a where clause, click the Add Where Clause button. After you add a column, you can click the column name and select a new name from the drop-down list box. To remove a where clause from your operation, select the attribute that you want to remove and then click the Remove Where Clause button. You change the condition (and/or) by clicking the condition in the row that you want and selecting a condition from the drop-down list box. You change the operator by clicking the operator in the row that you want to change and selecting an operation from the drop-down list box.

The Exclude If Value Is Null option is used by the system for code generation. If you select this option, conditional logic is added to the generated code to not include fields with a null value. If a field has a null value, the field is not included in the where clause. The system builds the where clause using only those value object fields that are not null.

12.7.3.3 Order by Columns Tab

Use the Order by Columns tab to specify how you want the system to display the results. You specify sort criteria for the columns that you have selected and the order of the records for each column. Click the Add ordering button to add a column name, then change the column name by clicking the column name in the row that you want to change and selecting a new name from the drop-down list box. Use the Move Up and Move Down buttons to change the order of the column names that you enter. You can specify the order of the records within a column to be ascending or descending by selecting the row that has the column name and then clicking the ASC or DESC name under the Ordering column and selecting a new order from the drop-down list box.

After you complete the specifications for your Select call, click Next to see a preview page. The preview page shows a conceptual SQL statement based on the specifications you have entered. You can use the Back button to return to a previous page and modify your specifications. When you are satisfied with the specifications you have entered, click Finish. The wizard creates a Select database operation call where your cursor is located in the business service code, and it produces accompanying code. You must modify the Select call to include the appropriate value objects and to complete the generated code.

12.7.4 Creating an Insert Database Operation Call

If you selected the Insert database operation, the wizard opens the Insert Operation main page and displays information from the table or business view that you selected. The Insert operation main page has only one tab, Insert Columns.

The Insert Columns tab shows all of the columns that are available in the table (business view) that you selected. Each column from the table (business view) is displayed as a row and includes the column name, description of the column, column type, and column length, and indicates whether the column is a primary key. You can sort the rows by clicking in a column header. For example, when you click the Column Name header, you can sort the rows in ascending, descending, or default order by column name. You can sort by any one of the column headers.

From the table or business view, you select the columns that you want to use in your Insert database operation. You can select specific columns by selecting the check box in the appropriate row, or you can select all of the columns by clicking the Select All button. If you did not select all columns, you can select the Display Selected Only option to show only those columns that you selected for your Insert operation. You can clear all of your selections by clicking the Clear all button.

After you select the columns you want to use in your Insert database operation, click Next to see a preview page. The preview page shows a conceptual SQL statement. You can use the Back button to return to a previous page and select or clear columns from the table or business view. When you are satisfied with your selections, click Finish. The wizard creates an Insert database operation call where your cursor is located, and it produces accompanying code. You must modify the Insert call to include the appropriate value objects and you should review the generated code and update as necessary.

12.7.5 Creating an Update Database Operation Call

If you selected the Update database operation, the wizard opens the Update operation main page and displays information from the table or business view that you selected. The Update operation main page has two tabs, Update Columns and Where Clause.

12.7.5.1 Update Columns Tab

The Select Columns tab shows all of the columns that are available in the table (business view) that you selected. Each column from the table or business view is displayed as a row, and includes the column name, description of the column, and column type, and indicates whether the column is a primary key. You can sort the rows by clicking in a column header. For example, when you click the Column Name header, you can sort the rows in ascending, descending, or default order by column name.

12.7.5.2 Where Clause Tab

You use the where clause to set conditions for the attributes in your database operation. To add a where clause, click the Add Where Clause button. After you add a column, you can click the column name and select a new name from the drop-down list box. To remove a where clause from your operation, select the attribute that you want to remove and then click the Remove Where Clause button. You change the condition (and/or) by clicking the condition in the row that you want and selecting a condition from the drop-down list box. You change the operator by clicking the operator in the row that you want to change and selecting an operation from the drop-down list box.

After you complete the specifications for your Update call, click Next to see a preview page. The preview page shows a conceptual SQL statement based on the specifications you have entered. You can use the Back button to return to a previous page and modify your specifications. When you are satisfied with the specifications you have entered, click Finish. The wizard creates an Update database operation call where your cursor is located, and it produces accompanying code. You must modify the Update call to include the appropriate value objects and you must complete the generated code.

12.7.6 Creating a Delete Database Operation Call

If you selected the Delete database operation, the wizard opens the Delete operation main page, which contains no data, but has a Where Clause tab. You add a where clause by clicking the Add Where Clause button. After you add a column, you can click the column name in the row where you want to change the name and select a new name from the drop-down list box. To remove a where clause from your operation, select the attribute that you want to remove and then click the Remove Where Clause button. You change the condition (and/or) by clicking the condition in the row you want and selecting a condition from the drop-down list box. You change the operator by clicking the operator in the row you want to change and selecting an operation from the drop-down list box.

After you specify the information that you want to include in your Delete operation, click Next to see a preview page. The preview page shows a conceptual SQL statement. If you click Next without specifying a where clause, the wizard sends you a warning message. You can use the Back button to return to the Delete operation main page and modify your specifications. When you are satisfied with the specifications you have entered, click Finish. The wizard creates a Delete database operation call where your cursor is located, and it produces accompanying code. You must modify the Delete call to include the appropriate value objects and you should review the generated code and make necessary changes.