Transports and Interfaces: Siebel eBusiness Application Integration Volume III > Integrating with J2EE Application Server >

Generating JavaBeans for Business Services


This section describes how to generate JavaBeans for Siebel business services. For information on how to generate JavaBeans for Siebel integration objects, see Generating JavaBeans for Integration Objects.

You use the JavaBean Wizard to generate JavaBeans based on Siebel business services. The wizard produces JavaBeans for the business service and the input and output parameters for each business service method defined in Siebel Tools, as shown in Figure 11. If methods of the business service take an integration object as a parameter, the JavaBeans for the integration objects are not generated. In order to generate JavaBeans for integration objects, see Generating JavaBeans for Integration Objects. The business service, input and output parameters for each method have their own Java class, stored in the com.siebel.jdb.service.Business Service Name or com.siebel.jca.service. Business Service Name package.

Figure 11.  Generate Code Wizard Creates Java for Siebel Business Services

Click for full size image

To generate Java code for a Siebel Business Service

  1. Log in to Siebel Tools and lock the project you are going to work on.
  2. NOTE:  For information on how to use Siebel Tools and how to lock projects and so on, consult Siebel Tools Online Help.

  3. Select Business Service from the Types tab on the Object Explorer.
  4. Select the business service for which you want to create Java code, as shown in the following illustration.
  5. On the right top corner of the list, there is a set of three buttons. The following illustration shows the CC XML Converter business service highlighted.

    Click for full size image

  6. Click the Generate Code button.
  7. NOTE:  If the business service you selected is not available to be exported, you see an error message rather than the wizard.

  8. Complete the wizard:
    1. Leave the business service as is (there is only one applicable: the Siebel Code Generator).
    2. Select either JDB (Java Data Bean) or JCA (J2EE Connector Architecture/Siebel Resource Adapter) for the Supported Language.
    3. Browse to select an existing folder as the output folder. Your Java code for the selected business service will be stored in subdirectories there, as explained in the next section.
    4. Click Finish.

About the Folders and Files Created for Business Service Java

As shown in Figure 12, a new folder named com is created as the first subfolder under the folder you specified in the wizard as your root folder. Beneath it are the siebel\eai directories. Finally, under the service directory you find separate folders for the Java code generated for any business service for which you have generated Java code.

Figure 12.  Directory Structure Created to Contain Java Code for Integration Objects

Click for full size image

The files are created under the last leaf of the directory as shown in Figure 13.

Figure 13.  JavaBean Files for Sample Account Integration Object

Click for full size image

Naming Convention for Generated Code

Following are the naming conventions for generated code:

Package names

Start with com.siebel.local for integration object and com.siebel.service for business service and end with a modified primary class name with all special characters removed and all in lowercase.

Business service example, "Siebel Code Generator" --> "com.siebel.service.siebelcodegenerator"

Integration object example, "Siebel Way Cool Interface" --> "com.siebel.local.siebelwaycoolinterface"

Class names

All special characters are replaced with under bars ("_"). Business services will have "BusServAdapter" appended to the end, and integration objects will have "IO" appended to the end and the integration components will have "IC" appended to the end. Business service's method inputs will be the name of the method, defined in Tools, with either Input or Output appended to it respectively.

Business service example, "Siebel Code Generator" --> "SiebelCodeGeneratorBusServAdapter"

Integration object example, "Siebel Way Cool Interface" --> "SiebelWayCoolInterfaceIO"

Integration Component example, "Siebel Way Cool Interface Component" --> "SiebelWayCoolInterfaceComponentIC"

Other naming conventions

All special characters are replaced with under bars ("_"). All variables such as integration component fields or user properties will have a "f" pre-pended to the name. All business service methods will have a "m" pre-pended to the name.

Business service method example, "GenerateCode" --> "mGenerateCode"

Field example, "My Field" --> "fMy_Field"

Generated Java Files for a Typical Business Service

Table 25 provides an explanation for the Java classes generated for the CC XML Converter business service. JavaBeans generated for each business service vary based upon the method defined and the Input/Output arguments. The table is presented to give you an idea of the Java classes generated for a typical business service and an explanation for what each class represents. Please note that for the CC XML Converter business service, the XMLToPropSet method does not have any Output parameters, which is why the output class for this method was not generated. Table 26, Table 27, and Table 28 show more specific information about the default methods.

Table 25.  Java File List for CC XML Converter Business Service
Java File
Description
CC_XML_Converter BusServiceAdapter.java
Java class that represents to the CC XML Converter business services. Provides a set of methods to construct the Business Service Adapter Class as well as invoke the business service methods.
PropSetToXMLInput.java
Java class that represents the input parameters of the PropSetToXML method of the CC XML Converter business service. Provides a set of access methods to set and get the method input parameters as well as convert to and from a property set.
PropSetToXMLOutput.java
Java class that represents the output parameters of the PropSetToXML method of the CC XML Converter business service. Provides a set of access methods to set and get the method output parameters as well as convert to and from a property set.
XMLToPropSetInput.java
Java class that represents the input parameters of the XMLToPropSet method of the CC XML Converter business service. Provides a set of access methods to set and get the method input parameters as well as convert to and from a property set.

Table 26.   Java Methods for the Business Service Adapter Class
Method
Description
BusServAdapter()
Constructor.
BusServAdapter(SiebelDataBean)
Constructor.
BusServAdapter(String, String, String)
Constructor.
mBusSvcMethodName(methodInput)
Method that invokes the specified business service method.

Table 27.  Default Java Methods for Business Service Method Input Parameters
Method
Description
methodInput()
Constructor.
methodInput(SiebelPropertySet)
Constructor.
fromPropertySet(SiebelPropertySet)
Method that allows a developer to define an integration object from a property set.
toPropertySet()
Method that serializes the object into a Siebel property set.
getfMethodArgName()
Access method to get the value of business service method argument.
setfMethodArgName()
Access method to set the value of a business service method argument.

Table 28.  Default Java Methods for Business Service Method Output Parameters
Method
Description
MethodOutput()
Constructor.
methodOutput(SiebelPropertySet)
Constructor.
fromPropertySet(SiebelPropertySet)
Method that allows a developer to define an integration object from a property set.
toPropertySet()
Method that serializes the object into a Siebel property set.
getfMethodArgName()
Access method to get the value of business service method argument.
setfMethodArgName()
Access method to set the value of a business service method argument.


 Transports and Interfaces: Siebel eBusiness Application Integration Volume III 
 Published: 23 June 2003