Developing and Deploying Siebel eBusiness Applications > Creating a Virtual Business Component > Creating a Business Service >

Defining Business Service Scripts


After defining the Business Service, you can define the business service scripts that actually do the processing associated the with the NREC External Text Handler business service object. Sample code for this example is shown in Code Sample.

Business Service methods to implement are listed in Table 9.

Table 9. Business Service Methods
Method
Custom Method Name in Code Sample
Description
Init
Pal_Init
Creates the initial link between the columns in the VBC and the columns in the external data source.
Insert
Pal_Insert
Inserts a record into the external data source.
PreInsert
Pal_PreInsert
Provides any default values for new rows. In the current example, there are no default values.
Query
Pal_Query
Queries the external datasource and returns rows that match a given value. In the current example, the method queries the text file and returns rows that have a matching value for the current House_ID field.
Service_PreInvokeMethod
Service_PreInvokeMethod
Handles requests that come into the business service and calls other functions as appropriate.
Update
Not used in sample code
Updates an existing row in an external datasource.
Delete
Not used in sample code
Deletes a row in the external datasource.

For more information about business service methods, see Siebel Object Interfaces Reference.

To define and write the business service script for NREC External Text Handler

  1. Select the NREC External Text Handler business service.
  2. With the business service selected, right-click, and then choose Edit Server Scripts.
  3. Select Visual Basic as the scripting language and then click OK.
  4. The script editor appears with Service_PreInvokedMethod selected as the service.

  5. Enter the custom functions by doing the following:
    1. Expand the (general) icon in the script editor and then select the (declarations) icon.
    2. In the text entry window, enter the code for the custom function.
    3. After finishing the function and saving your work, an icon representing the function appears in the left pane.
    4. Repeat steps Step a through Step c for each custom function.
    5. Click for full size image

  6. Select the Service_PreInvokeMethod icon and then enter the code in text entry window.
  7. Select the (declarations) icon and then type the code in the text entry window.
  8. After saving your work, Business Service Server Script objects are automatically created.

    Click for full size image


 Developing and Deploying Siebel eBusiness Applications 
 Published: 18 April 2003