Siebel Tools >  Creating a business service in Siebel Tools

Defining a Business Service in Siebel Tools

You declaratively define the business service in Siebel Tools and then add your scripts to the business service in the Script Editor.

To define a business service in Siebel Tools

      Start Siebel Tools.       Select and lock the project you want to associate your business service with.

NOTE:  Each business service must belong to a project and the project must be locked. For details, see Siebel Tools Reference.

      Select the EAI Business Services object in the Tools Object Explorer.

The list of predefined business services appears in the right panel.

      Choose Edit New Record to create a new business service. Type a name for your business service in the Name field. Type the name of the project you locked in       Step 2, in the Project field. Choose the appropriate class for your business service,from the Class picklist. Step off the current record to save your changes.

    Data transformation business services should use the CSSEAIDTEScriptService class.

    Other business services will typically use the CSSService class.

After this we have to create a method to pass arguments

Defining Business Service Methods

 

Business services contain related methods that provide the ability to perform a particular task or set of tasks.

NOTE:  For details on business service methods, see Siebel Tools Online Help.

To define a business service method

       With your business service selected, double-click the Business Services Methods folder in the Siebel Tools Object Explorer.

The Business Services Methods list appears below the list of business services. If you have already defined methods for the selected business service, the method names appear in the Business Services Methods list.

      Choose Edit > New Record to create a new method. Type the name of the method in the Name field.

Defining Business Service Method Arguments

 

Each method can take one or more arguments. The argument is passed to the method and consists of some data or object that the method processes to complete its task.

To define the business service method arguments

       With your business service selected, double-click the Business Service Method Arg folder, in the Tools Object Explorer, to display the Business Service Method       Args list. Choose       Edit > New Record to create a blank method argument record. Type the name of the argument in the Name field.

NOTE:  If you plan to use this business service in a Siebel Client, you need to specify the Display Name as well.

      Enter the data type in the Data Type field. Check the Optional check box if you do not want the argument to be required for the method. Choose a Type for the           argument. Refer to the following table for a list of different types and their descriptions.
Argument Description
Input This type of argument serves as input to the method.
Input/Output This type of argument serves as both input to the method and output from the method.
Output This type of argument serves as output from the method.

 

 

Business service scripts supply the actual functionality of the business service in either Siebel VB or Siebel eScript. As with any object, the script you provide is attached to the business service.

 

To define and write the business service script

 

       Start Siebel Tools. Select the business service for which you want to write a script. Right-click to display a pop-up menu. Choose Edit Server Scripts. Select either        eScript or Visual Basic for your scripting language.

 

Service-PreInvokedMethod is selected as the service.

 

NOTE:  To write any Siebel VB script in the Business Services, your deployment platform must support Siebel VB.

 

      Type your script into the Script Editor.

 

NOTE:  You need to write your business service in eScript if you want to use the DTE scripts. For details on scripting, see Siebel Tools Online Help.

 

Escript reference - http://download.oracle.com/docs/cd/B40099_02/books/eScript/eScriptTOC.html

Example escript in

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

if (MethodName == "Execute")

{

//GetShipmentInfo (Inputs, Outputs);

RunATPTest (Inputs, Outputs);

}

 

if (MethodName == "WriteXML")

{

//GetShipmentInfo (Inputs, Outputs);

WriteXMLFile (Inputs,"d:\\ATPBeforeExecute.xml");

}

 

return (CancelOperation);

}

 

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

var ret= CancelOperation;

 

 

if (MethodName=="Execute")

{

Execute(Inputs,Outputs);

}

else

{

TheApplication.ErrorText("Invalid function name. Valid method name is 'Execute'");

ret=ContinueOperation;

}

return ret;

}

Specifying Business Service Subsystems

 

You can optionally specify a business service subsystem. A business service subsystem is a server component that encapsulates a large amount of functionality and that is already included in the Siebel repository. Business service subsystems define particular events upon which the subsystem will be called. The subsystems can also trigger other events, depending on how they are defined. Examples of business service subsystems are presented in Table 7.

 

Table 7.  Business Service Subsystems
Subsystem Description
EAISubsys Defines events for a variety of eAI operations, including the initiation of eAI wizards, calls to eAI adapters, and calls to eAI validation routines.
SAPSubsys Defines a variety of parameters to help determine the type of SAP object being integrated, the transport mechanism, user name and password combinations, and SAP program ID.
Workflow Defines both events and parameters to signal and determine behaviors based on the initiation of workflow processes, search specifications, and Row Id.
XMLCnv Defines events regarding debugging information and responses from the XML parser.

 

To specify a business service subsystem

 

       With your business service selected, double-click the Business Service Subsystem folder in the Tools Object Explorer to display a list of subsystems.        Choose Edit > New Record to create a blank business service subsystem record. Choose an existing business service subsystem name from the Subsystem picklist.

 

Defining Business Service User Properties

User properties, also known as User Props, are optional variables that you can use to define default values for your business services. When a script or control invokes your business service, one of the first tasks the service performs is to check the user properties to gather any default values that will become input arguments to the service's methods.

 

To define business service user properties

 

       With your business service selected, double-click the Business Service User Prop folder in the Tools Object Explorer to display the list of Business Service User       Props. Choose Edit > New Record to create a blank user property record. Type the name of the user property in the Name field. Type a value in the Value field.
 
      The value can be an integer, a quoted string, or a Boolean