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 with the NREC Text File Handler business service object. Sample code for this example is shown in Code Samples. Business Service methods to implement are listed in Table 11.
Table 11. Business Service Methods
|
Custom Method Name in Code Sample |
|
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 data source 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 data source. |
Delete |
Not used in sample code |
Deletes a row in the external data source. |
For more information about business service methods, read Siebel Object Interfaces Reference. To define and write the business service script for NREC Text File Handler
- Select the NREC Text File Handler business service.
- With the business service selected, right-click, and then choose Edit Server Scripts.
- Select Visual Basic as the scripting language and then click OK.
The script editor appears with Service_PreInvokedMethod selected as the service.
- Enter the custom functions by doing the following.
- Expand the (general) icon in the script editor and then select the (declarations) icon.
- In the text entry window, enter the code for the custom function.
- Choose File > Save.
An icon representing the function appears in the left pane as shown in the following illustration.
- Repeat Step a through Step c for each custom function.
- Select the Service_PreInvokeMethod icon. Copy the sample code into the text entry window, replacing the existing stub text.
- Choose File > Save.
After saving your work, Business Service Server Script objects are available, as shown in the following illustration.
|